"Henrik Stidsen" <nntpspam@hs235.dk> wrote:
>After serious thinking S. M wrote :
>> Jeg har installeret Apache 2.0.52 med php 4.3.9, som virker fint, men
>> nu vil jeg gerne kunne lave en funktion på min hjemmeside der hedder
>> "tip en ven" samt en formulart, men hvad kræver det for at kunne sende
>> den form for beskeder.
>
>At du behandler de data browseren sender og så bruger du PHP's mail()
>kommando.
>
>--
>Henrik Stidsen -
http://henrikstidsen.dk/
>"Health nuts are going to feel stupid someday, lying in hospitals dying
>of nothing." - Redd Foxx
>
>
Kan du forklare noget mere omkring php mail ?
Og hvad får de ellers ud af min kode ?
----------------------------- min kode --------------------------
<HTML>
<HEAD>
<TITLE>Tip en ven -
www.kirstinemikkelsen.dk
<link href="css/formular.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #999999;
}
..oversk {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
color: #000000;
}
-->
</style></HEAD>
<BODY>
<?php
// number of friend feilds to put on the page
$tellnumber = "3";
// subject of email
$subject = "Prøv at kikke forbi denne hjemmeside ";
// Message sent in the email
$message = "Kik forbi denne hjemmeside
http://www.kirstinemikkelsen.dk";
// url to redirect user to once they click submit
$thankyouurl = "tellfriend_kvittering.htm";
//////////////////////////////////////////////////////////////////////////////////
// DO NOT EDIT BELOW THIS LINE
//
//////////////////////////////////////////////////////////////////////////////////
if($submitform) {
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
if($$tname OR $$temail) {
if(!$$tname) {
$error .= "Mangler vens navn, Ven nr. $num<BR>";
}
if(!$$temail) {
$error .= "Mangler vens navn, Ven nr. $num<BR>";
}
}
if($$temail) {
if(!ereg("@",$$temail)) { $error .= "Invalid e-mail, Ven $num<BR>"; }
if(!ereg("\.",$$temail)) { $error .= "Invalid e-mail, Ven $num<BR>"; }
}
}
if(!$tname) {
$error .= "Mangler dit navn<BR>";
}
if(!ereg("@",$email)) { $error .= "Invalid e-mail <BR>"; }
if(!ereg("\.",$email)) { $error .= "Invalid e-mail <BR>"; }
if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="100%" BGCOLOR="#999999">
<TABLE WIDTH="394" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#999999">
<center class="oversk">Fejl</center></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#999999">
<center class="oversk"><?php echo $error; ?></center></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
<P><CENTER> </CENTER></P>
<P><CENTER>
</CENTER>
</P>
</BODY></HTML>
<?php
exit();
}
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
$then = $$tname;
if($$temail AND $$tname) {
mail($$temail,"$subject","
Hej, $then
$message
Fra
$name
","Fra: $name <$email>");
}
}
header("Location: $thankyouurl");
exit();
} else {
$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#999999\">
<P><CENTER><FONT COLOR=\"#000000\" SIZE=\"1\"
FACE=\"Verdana\">$num</FONT></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#999999\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\"
SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#999999\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}
?>
<P><CENTER class="oversk"><b></b>Tip en ven om
www.kirstinemikkelsen.dk
<FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE
BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD WIDTH="100%" BGCOLOR="#999999">
<TABLE WIDTH="394" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#999999">
<P><CENTER class="oversk">Dit navn
</CENTER></TD>
<TD WIDTH="25%" bgcolor="#999999">
<P><CENTER class="oversk">Din email
</CENTER></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#999999">
<P><CENTER>
<INPUT NAME="name" TYPE="text" SIZE="25"></CENTER></TD>
<TD WIDTH="25%" BGCOLOR="#999999">
<INPUT NAME="email" TYPE="text" SIZE="25">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P><P><CENTER><TABLE BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD WIDTH="100%" BGCOLOR="#999999">
<TABLE WIDTH="394" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR bgcolor="#999999">
<TD WIDTH="49%"></TD>
<TD WIDTH="26%">
<P><CENTER class="oversk">Vens navn
</CENTER></TD>
<TD WIDTH="25%">
<P><CENTER class="oversk">Vens email
</CENTER></TD>
</TR><?php echo $theboxes; ?></TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Send">
<input type="reset" name="Reset" value="Slet alt">
</CENTER></FORM>
<P><CENTER> </CENTER></P>
<P></P>
</BODY></HTML>
<?php
exit();
}
?>
Med venlig hilsen
S. Mik.