Avatar billede flying_bryan Nybegynder
28. maj 2007 - 09:22 Der er 48 kommentarer

Send data til email i PHP

Hey Folkens. Jeg er igang med at lave en kontaktside hvor jeg har lavet en mailformular. Her kan indtastes forskellige ting. Jeg kan så bare ikke få det til at funge, bære over med mig jeg er stadig lidt rookie i php programmeringen :D

mailformularen kan også ses her http://brian.mmd2007.ots.dk/kontakt.php
- - - - - - - - - - - - - - - - - - - - -


<?php
  /* Her tjekkes om felterne er udfyldt*/
  if (isset($_POST['submit']))
               
    $navn = $_POST['navn'];
    $email = $_POST['email'];
    $tekstfelt = $_POST['tekstfelt'];
    {
               
    mail("notifier_dk@hotmail.com.dk, $_POST name='$navn', mail='$email', body='$tekstfelt'");
               
    /* Vi fortæller brugeren at e-mailen nu er sendt */
    echo "Vi takker for din interesse for .:NOTIFIER";
    or else echo "Alle felter skal udfyldes";
    }
    ?>
   
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"> Afdeling: <br />
        <select name="valg-box" class="style1"  style="color:#000000">
    <option value="Vælg" selected="selected">Vælg</option>
              <option value="notifier_dk@hotmail.com">Salgsafdelingen</option>
                  <option value="notifier_dk@hotmail.com">Presseafdelingen</option>
            <option value="notifier_dk@hotmail.com">Produktion</option>
          </select>
          <br />
          <br />
      <span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
Avatar billede jakobdo Ekspert
28. maj 2007 - 09:55 #1
Du kalder mail() funktionen forkert.
Prøv at se funktionen her: http://www.php.net/manual/en/function.mail.php

mail() tager primært 3 eller 4 parametre.
nummer 1, hvem er modtager af emailen.
nummer 2, hvad er emnet af emailen.
nummer 3, hvad skal indholdet af emailen være.
nummer 4, hvem skal være afsender af emailen, skal dog skrives i headers.
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 10:13 #2
Kan ikek lige se mig helt ud af det. . Kan du foreklare mig det lidt nemmere? :D
Avatar billede nwn Nybegynder
28. maj 2007 - 10:34 #3
Du skal bruge noget i denne stil:

$to      = 'din@email.dk';
$subject = 'Kontakt fra min hjemmeside';
$message = '$_POST[tekstfelt]';
$headers = '$_POST[email]' . "\r\n" .
'Reply-To: din@email.dk' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
Avatar billede nwn Nybegynder
28. maj 2007 - 10:35 #4
Du kan så også lave det, med variabler.

Eks

$emne = "Kontakt fra min hjemmeside";

$subject = $emne;
Avatar billede michael_stim Ekspert
28. maj 2007 - 10:38 #5
Hmm? Troede $subject også var en variabel ;o)
Avatar billede jakobdo Ekspert
28. maj 2007 - 10:39 #6
Test lige denne kode:

<?php
/* Her tjekkes om SUBMIT knapper er trykket*/
if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("notifier_dk@hotmail.com.dk, $emne, $besked, $headers);
       
        /* Vi fortæller brugeren at e-mailen nu er sendt */
        echo "Vi takker for din interesse for .:NOTIFIER";
    }
    else
    {
        echo "Alle felter skal udfyldes";
    }
}
?>
 
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"> Afdeling: <br />
        <select name="valg-box" class="style1"  style="color:#000000">
    <option value="Vælg" selected="selected">Vælg</option>
              <option value="notifier_dk@hotmail.com">Salgsafdelingen</option>
                  <option value="notifier_dk@hotmail.com">Presseafdelingen</option>
            <option value="notifier_dk@hotmail.com">Produktion</option>
          </select>
          <br />
          <br />
      <span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
Avatar billede nwn Nybegynder
28. maj 2007 - 10:45 #7
michael_stim --->

Tror ikke jeg fik sovet nok i nat q:

blev vækket kl 7.
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 10:58 #8
Den giver mig stadig denne besked på siden

Warning: mail() expects at least 3 parameters, 1 given in /virtualhosts/mmd2007.ots.dk/subdomains/brian/kontakt.php on line 131
Avatar billede jakobdo Ekspert
28. maj 2007 - 11:13 #9
Ret lige: mail("notifier_dk@hotmail.com.dk, $emne, $besked, $headers);
til: mail("notifier_dk@hotmail.com.dk", $emne, $besked, $headers);
Avatar billede jakobdo Ekspert
28. maj 2007 - 11:13 #10
Er det ikke også en forkert email? hotmail.com.dk ?
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 11:22 #11
emailen hedder notifier_dk@hotmail.com
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 11:27 #12
Det fungere nu men nu skal jeg bare have sat de to "echo" som siger "vi takker.." og "alt skal..." til at komme frem med font-color white, hvordan får jeg lige fortalt den det?
Avatar billede jakobdo Ekspert
28. maj 2007 - 11:40 #13
Det gør du så f.eks. med:

echo '<span style="color:white;">TEKST MED HVID SKRIFT</span>';
Avatar billede jakobdo Ekspert
28. maj 2007 - 11:40 #14
Og du får et svar!
Avatar billede nwn Nybegynder
28. maj 2007 - 11:41 #15
<?php
/* Her tjekkes om SUBMIT knapper er trykket*/
if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("notifier_dk@hotmail.com.dk, $emne, $besked, $headers);
       
        /* Vi fortæller brugeren at e-mailen nu er sendt */
        echo "<font color='white'>Vi takker for din interesse for .:NOTIFIER </font>";
    }
    else
    {
        echo "<font color='white'>Alle felter skal udfyldes</font>";
    }
}
?>
 
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"> Afdeling: <br />
        <select name="valg-box" class="style1"  style="color:#000000">
    <option value="Vælg" selected="selected">Vælg</option>
              <option value="notifier_dk@hotmail.com">Salgsafdelingen</option>
                  <option value="notifier_dk@hotmail.com">Presseafdelingen</option>
            <option value="notifier_dk@hotmail.com">Produktion</option>
          </select>
          <br />
          <br />
      <span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
Avatar billede nwn Nybegynder
28. maj 2007 - 11:42 #16
Ups, så ikke der var kommet svar.

Skulle lige have opdateret ;D
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 11:50 #17
Nu siger den pludselig sådan her -->

Parse error: syntax error, unexpected $end in /virtualhosts/mmd2007.ots.dk/subdomains/brian/kontakt.php on line 187
Avatar billede nwn Nybegynder
28. maj 2007 - 11:53 #18
Prøv med:

<?php
/* Her tjekkes om SUBMIT knapper er trykket*/
if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("notifier_dk@hotmail.com.dk, $emne, $besked, $headers);
       
        /* Vi fortæller brugeren at e-mailen nu er sendt */
        echo "<font color='white'>Vi takker for din interesse for .:NOTIFIER </font>";
    }
    else
    {
        echo "<font color='white'>Alle felter skal udfyldes</font>";
    }
?>
 
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"> Afdeling: <br />
        <select name="valg-box" class="style1"  style="color:#000000">
    <option value="Vælg" selected="selected">Vælg</option>
              <option value="notifier_dk@hotmail.com">Salgsafdelingen</option>
                  <option value="notifier_dk@hotmail.com">Presseafdelingen</option>
            <option value="notifier_dk@hotmail.com">Produktion</option>
          </select>
          <br />
          <br />
      <span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
<?php
}
?>
Avatar billede jakobdo Ekspert
28. maj 2007 - 11:57 #19
Hvad står der på linie 187 eller omkring linie 187?
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:00 #20
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("notifier_dk@hotmail.com", $emne, $besked, $headers);
       
        /* Vi fortæller brugeren at e-mailen nu er sendt */
    if (isset) echo "Vi takker for din interesse for .:NOTIFIER";
    }
    else
    {
        echo "Alle felter skal udfyldes";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlf&oslash;j NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">G&oslash;r NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:01 #21
Hov. . overstående kode er alt kode på hele siden
Avatar billede nwn Nybegynder
28. maj 2007 - 12:02 #22
flying_bryan det her virker:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("notifier_dk@hotmail.com", $emne, $besked, $headers);
       
        /* Vi fortæller brugeren at e-mailen nu er sendt */
    if (isset) echo "Vi takker for din interesse for .:NOTIFIER";
    }
    else
    {
        echo "Alle felter skal udfyldes";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlf&oslash;j NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">G&oslash;r NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
?>
Avatar billede nwn Nybegynder
28. maj 2007 - 12:07 #23
Hvis salgsafdeling, presseafdeling og produktion har forskellig email i value, så skal denne linie ændres:

mail("notifier_dk@hotmail.com.dk, $emne, $besked, $headers);

til

mail("$_POST[valg-box], $emne, $besked, $headers);

Du kunne også tilføje:

$til = '$_POST[valg-box]';

under $headers =......

og så ændre: mail("$_POST[valg-box], $emne, $besked, $headers);

til: mail("$til, $emne, $besked, $headers);
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:10 #24
Det funger nu ja.
Den echo´r men den gør det hele tiden selv om der ikke er skrevet i emailformularen.

Det skal sættes sådan op at hvis
alle felter er udfyldt skal skal den sig: "Vi takker for din interesse for .:NOTIFIER"

Hvis de ikke er udfyldt skal den sige: "Alle felter skal udfyldes".
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:27 #25
Hvis i forstår, hvad jeg mener?
Avatar billede nwn Nybegynder
28. maj 2007 - 12:28 #26
Ja, prøv med denne her:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
        $til = "$_POST[valg-box]";
   
        mail("$til", $emne, $besked, $headers);
       
      if ( empty ( $til )){
      } elseif ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlf&oslash;j NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">G&oslash;r NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
?>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:36 #27
Efter Jeg har sat dine koder ind, siger den sådan her igen -->
Parse error: parse error, unexpected $end in D:\S K O L E\E K S A M E N 4 S E M E S T E R\Hjemmeside\kontakt.php on line 196
Avatar billede nwn Nybegynder
28. maj 2007 - 12:37 #28
Okay, den her virker, du skal ikke sætte noget ind i den:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
        $til = "$_POST[valg-box]";
   
        mail("$til", $emne, $besked, $headers);
       
      if ( empty ( $til )){
      } elseif ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlf&oslash;j NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">G&oslash;r NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
}
?>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:48 #29
Der sker ikke rigtig noget efter jeg har sat koden ind. .  tjek selv

http://brian.mmd2007.ots.dk/kontakt.php

Koden skal være uden der der "Valg-box"
Avatar billede nwn Nybegynder
28. maj 2007 - 12:51 #30
Prøv denne:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
        $til = "$_POST[valg-box]";
   
        mail("$til", $emne, $besked, $headers);
       
      if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlf&oslash;j NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">G&oslash;r NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
}
?>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 12:56 #31
Avatar billede nwn Nybegynder
28. maj 2007 - 13:15 #32
Den her virker ved mig:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("noreply@hotmail.com", $emne, $besked, $headers);
       
      if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
   
    }
?>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlføj NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">Gør NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
}
?>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 13:22 #33
Alle mine inputs felter forsvinder?
Avatar billede nwn Nybegynder
28. maj 2007 - 13:31 #34
Så prøv denne:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            <?php
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("noreply@hotmail.com", $emne, $besked, $headers);
       
      if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
   
    } else {
echo "</p>
          <form action=\"<?php echo $_SERVER['PHP_SELF'];?>\" method=\"post\">
        <p class=\"style1\"><span class=\"style12\">Navn:</span> <br />
          <input name=\"navn\" type=\"text\" class=\"style1\" value=\"\" size=\"35\" maxlength=\"100\" style=\"color:#000000\" />
          <br />
          <br />
      <span class=\"style12\">Email:</span> <br />
      <input name=\"email\" type=\"text\" class=\"style1\" value=\"\" size=\"35\" maxlength=\"100\" style=\"color:#000000\" />
          <br />
          <br />
      <span class=\"style12\">Besked:</span>
          <br />
      <textarea name=\"tekstfelt\" cols=\"32\" rows=\"5\" style=\"color:#000000\"></textarea>
          <br />
          <br />
          <input name=\"submit\" type=\"submit\" class=\"style1\" value=\"Send\"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align=\"left\" valign=\"bottom\"><div align=\"left\"><img src=\"tilfoej-logo.jpg\" width=\"200\" height=\"15\" align=\"left\" /></div></td>
        </tr>
      <tr>
        <td height=\"30\" valign=\"middle\" bgcolor=\"#000000\"><div align=\"left\"><span class=\"style1\">Tlføj NOTIFIERs hjemmeside til foretrukne <a href=\"java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')\">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign=\"middle\" bgcolor=\"#000000\"><img src=\"menu-logo-startside.jpg\" width=\"200\" height=\"15\" /></td>
        <td rowspan=\"6\">&nbsp;</td>
        </tr>
      <tr>
        <td height=\"19\" valign=\"middle\" bgcolor=\"#000000\" class=\"style1\">Gør NOTIFIERs hjemmeside til din startside <a href=\".: N O T I F I E R\" onClick=\"this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');\">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height=\"20\" valign=\"middle\" bgcolor=\"#000000\" class=\"style1\">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>";
}
}
}
?>
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 13:32 #35
Tror ikke den html <form> skal være en dela f PHP´n for ellers forsvinder inputfelterne
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 13:35 #36
Så kommer denne-->

Parse error: parse error, unexpected T_ELSE in D:\S K O L E\E K S A M E N 4 S E M E S T E R\Hjemmeside\kontakt.php on line 146
Avatar billede nwn Nybegynder
28. maj 2007 - 13:41 #37
Er det iorden hvis jeg laver det i 2 filer ?

kontakt.php og send_email.php ??
Avatar billede nwn Nybegynder
28. maj 2007 - 13:41 #38
Eller nej, jeg laver det i 1 fil.

2 sekundter
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 13:45 #39
okay
Takker :D
Avatar billede nwn Nybegynder
28. maj 2007 - 13:50 #40
Sådan, det virker ved mig, og input felterne bliver vist. Her er koden:

<?php
if($_GET['email'] == '')
{
    /* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("noreply@hotmail.com", $emne, $besked, $headers);
       
      if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER";
}
?>
Avatar billede nwn Nybegynder
28. maj 2007 - 13:52 #41
Hov, fejl. Her er koden:

<?php
if($_GET['email'] == '')
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TILFØJ SIDEN TIL FORETRUKNE-->
<script type="text/javascript">
var bookmarkurl=window.top.document.location
var bookmarktitle="Tips og Tricks"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>

<param NAME="wmode" Value="transparent";>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: N O T I F I E R</title>
<style type="text/css">
<!--
body {
    background-image: url(mellemrum-3.jpg);
    background-repeat: repeat-x;
    background-color: #000000;
    margin-left: 0px;
    margin-right: 40px;
}
.style1 {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
}
.style2 {color: #000000}
.style11 {font-size: 3px}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #0090A7;
    text-decoration: none;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style12 {color: #FFFFFF}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('menu/forside-over.jpg')">
<table width="817" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="273" height="70" background="Logo.jpg">&nbsp;</td>
    <td width="147" valign="bottom"><div align="left" class="style1"> A new way of reminding </div></td>
    <td width="397" valign="bottom"><div align="right"><span class="style1"><a href="index.html" target="_self"><img src="home-ikon.jpg" width="20" height="15" border="0" /></a><span class="style2">-</span><img src="kontakt-ikon.jpg" width="20" height="15" /></span></div></td>
  </tr>
</table>
<table width="850" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="1000" height="250" valign="top" background="bjaelke-5.gif">&nbsp;</td>
  </tr>
  <tr>
    <td height="143" valign="top"><table width="818" border="0" cellpadding="0" cellspacing="2">
      <tr>
        <td colspan="3"><span class="style11">1</span></td>
        </tr>
      <tr>
        <td width="200" align="left"><div align="left"><img src="menu-logo.jpg" width="200" height="15" align="left" /></div></td>
        <td width="8" rowspan="4">&nbsp;</td>
        <td width="610"><img src="menu-logo-2.jpg" width="608" height="15" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#000000"><div align="left">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="190" height="75">
            <param name="movie" value="ClearWhiteMenu1225252.swf" />
            <param name="quality" value="high" />
           
            <embed src="ClearWhiteMenu1225252.swf" width="190" height="75" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object>
        </div></td>
        <td rowspan="8" valign="top" bgcolor="#000000">
          <p>
            </p>
          <form action="<?php echo $_SERVER['PHP_SELF'];?>?email=sendt" method="post">
        <p class="style1"><span class="style12">Navn:</span> <br />
          <input name="navn" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Email:</span> <br />
      <input name="email" type="text" class="style1" value="" size="35" maxlength="100" style="color:#000000" />
          <br />
          <br />
      <span class="style12">Besked:</span>
          <br />
      <textarea name="tekstfelt" cols="32" rows="5" style="color:#000000"></textarea>
          <br />
          <br />
          <input name="submit" type="submit" class="style1" value="Send"/>
          </p>
        </form>
      </tr>
     
      <tr>
        <td align="left" valign="bottom"><div align="left"><img src="tilfoej-logo.jpg" width="200" height="15" align="left" /></div></td>
        </tr>
      <tr>
        <td height="30" valign="middle" bgcolor="#000000"><div align="left"><span class="style1">Tlføj NOTIFIERs hjemmeside til foretrukne <a href="java script:window.external.AddFavorite('http://brian.mmd2007.ots.dk', 'NOTIFIER - A new way of reminding')">Klik her</a></span></div></td>
        </tr>
      <tr>
        <td valign="middle" bgcolor="#000000"><img src="menu-logo-startside.jpg" width="200" height="15" /></td>
        <td rowspan="6">&nbsp;</td>
        </tr>
      <tr>
        <td height="19" valign="middle" bgcolor="#000000" class="style1">Gør NOTIFIERs hjemmeside til din startside <a href=".: N O T I F I E R" onClick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://brian.mmd2007.ots.dk/');">Klik her</a>&nbsp;</td>
      </tr>
      <tr>
        <td height="20" valign="middle" bgcolor="#000000" class="style1">&nbsp;</td>
      </tr>
     
     
    </table></td>
  </tr>
</table>
<p><br />
</p>
</body>
</html>
<?php
}
if($_GET['email'] == 'sendt')
{
/* Her tjekkes om SUBMIT knapper er trykket*/
    if(isset($_POST['submit']))
{
    /* Her tjekkes om felterne er udfyldt*/
    if(isset($_POST['navn']) && isset($_POST['email']) && isset($_POST['tekstfelt']))
    {
        $navn = $_POST['navn'];
        $email = preg_replace('/\\r|\\n|\\r\\n/', '', $_POST['email']);
        $tekstfelt = $_POST['tekstfelt'];
       
        $emne = 'Email afsendt fra PHP';
        $besked  = 'Navn: ' . $navn . "\r\n";
        $besked .= 'Email: ' . $email . "\r\n";
        $besked .= 'Besked: ' . $tekstfelt . "\r\n";
        $headers = "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion();
   
        mail("noreply@hotmail.com", $emne, $besked, $headers);
       
      if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";
    }
    else
    {
        echo "Vi takker for din interesse for .:NOTIFIER<br><br><a href='kontakt.php'>Tilbage</a>";
}
}
}
}
?>
Avatar billede nwn Nybegynder
28. maj 2007 - 13:59 #42
Og ændre lige

if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tesktfelt'] )){
        echo "Alle felter skal udfyldes";

til

if ( empty ( $_POST['navn'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['email'] )){
        echo "Alle felter skal udfyldes";
      } elseif ( empty ( $_POST['tekstfelt'] )){
        echo "Alle felter skal udfyldes";
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 14:01 #43
1 - Den her sender ikke mailen til notifier_dk@hotmail.com
2 - uanset om man skriver noget i felterne eller ej kommer medl: "Alle felter skal udfyldes"

3 - Ville gerne have meddelsen, om den er send elelr ej, kommer lige oppe over "navn" inputfeltet og så i Font:Verdana i str. 10

Dan prøve og tjekke hvordan det køre nu på http://brian.mmd2007.ots.dk/
Avatar billede jakobdo Ekspert
28. maj 2007 - 14:02 #44
flying_bryan: Tror du ikke snart det kunne være tid til at lær lidt php? Det er så basic php vi snakker her, så hvis du har planer om selv at kode på sigt, så burde du selv sidde og lege med koden og få det til at virke.
Ellers er det nok en OPGAVE, som hører til under OPGAVER.
Avatar billede nwn Nybegynder
28. maj 2007 - 14:09 #45
flying_bryan jeg skrev lige du skunne ændre noget.

Fordi næsten nederst står der et sted: } elseif ( empty ( $_POST['tesktfelt'] )){

Det er en taste fejl, jeg har skrevet tesktfelt og det skal du selv ændre til tekstfelt
Avatar billede nwn Nybegynder
28. maj 2007 - 14:10 #46
Og den kommer ikke til notifier_dk@hotmail.com fordi mailen står til noreply@hotmail.com. Ret det lige...
Avatar billede flying_bryan Nybegynder
28. maj 2007 - 14:12 #47
Ja det er rettet bare rolig.  . og det fungere også som det skal nu! takker for hjælpen :D
Avatar billede nwn Nybegynder
28. maj 2007 - 14:16 #48
Det lyder godt ;)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB

Cognizant Technology Solutions Denmark ApS

Energy Trading Project Manager – Consulting

SporingsGruppen ApS

Backend-udvikler

Cognizant Technology Solutions Denmark ApS

Sr. Test Analyst

Metroselskabet og Hovedstadens Letbane

ESDH-administrator med udviklerkompetencer

DEIF A/S

DevOps Engineer