comicw
11-10-2002, 04:54 PM
Hi,
I want to install a tell a friend script on my site (as part of an html page)
I've renamed the page to .php , but the php script still overrules the layout (everything is shown correctly except the right-side javascript menu bar). Here's the PHP script, in the post below, I've posted the html code for the page!
Please help me out!!!
The PHP script:
<?php
// number of friend fields to put on the page
$tellnumber = "5";
// subject of email
$subject = "Beleggingsvisie: uitnodiging";
// Message sent in the email
$message = "Op www.beleggingsvisie.be vindt u een aparte kijk op beleggen, die bewezen heeft 6 jaar op rij succesvol te kunnen zijn. Neem dus beslist eens een kijkje";
// url to redirect user to once they click submit
$thankyouurl = "http://www.beleggingsvisie.be";
/////
if($submitform) {
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
if($$tname OR $$temail) {
if(!$$tname) {
$error .= "Missing Friends Name, Friend $num<BR>";
}
if(!$$temail) {
$error .= "Missing Friends Email, Friend $num<BR>";
}
}
if($$temail) {
if(!ereg("@",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
if(!ereg("\.",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
}
}
if(!$tname) {
$error .= "Missing your name<BR>";
}
if(!ereg("@",$email)) { $error .= "Invalid Email Address<BR>"; }
if(!ereg("\.",$email)) { $error .= "Invalid Email Address<BR>"; }
if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC">
<TABLE WIDTH="400" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#0033CC">
<B><FONT COLOR="#ffffff" SIZE="-1" FACE="Tahoma">Error</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#ffffff">
<FONT COLOR="#000000" SIZE="-1" FACE="Tahoma"><?php echo $error; ?></FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
</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","
$then,
$message
Met vriendelijke groeten,
$name
","From: $name <$email>");
$youremail = "visie@beleggingsvisie.be";
$yoursubject = "Tell a friend werd gebruikt door: $name";
$yourmessage = "Tell a friend werd gebruikt door: $name
Friends email: $temail
Zenders email: $email
Zenders name: $name
Verzonden boodschap: $message";
$reply = "Van: $youremail";
mail($youremail,$yoursubject,$yourmessage,$reply);
}
}
exit();
} else {
$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#0033CC\">
<P><CENTER><B><FONT COLOR=\"#FFFFFF\" SIZE=\"-1\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#0033CC\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#0033CC\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}
?>
<P><CENTER><FONT FACE="Verdana" color="#0033CC" size="2"><B>Tell a friend</B></FONT></CENTER></P>
<FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD width= "60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw naam</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw e-mail</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><INPUT NAME="name" TYPE="text" SIZE="25"></CENTER></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<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="60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC"></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw vriend</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Zijn e-mail</FONT></B></CENTER></TD>
</TR><?php echo $theboxes; ?></TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Verzenden"></CENTER></FORM>
</BODY></HTML>
<?php
exit();
}
?>
I want to install a tell a friend script on my site (as part of an html page)
I've renamed the page to .php , but the php script still overrules the layout (everything is shown correctly except the right-side javascript menu bar). Here's the PHP script, in the post below, I've posted the html code for the page!
Please help me out!!!
The PHP script:
<?php
// number of friend fields to put on the page
$tellnumber = "5";
// subject of email
$subject = "Beleggingsvisie: uitnodiging";
// Message sent in the email
$message = "Op www.beleggingsvisie.be vindt u een aparte kijk op beleggen, die bewezen heeft 6 jaar op rij succesvol te kunnen zijn. Neem dus beslist eens een kijkje";
// url to redirect user to once they click submit
$thankyouurl = "http://www.beleggingsvisie.be";
/////
if($submitform) {
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
if($$tname OR $$temail) {
if(!$$tname) {
$error .= "Missing Friends Name, Friend $num<BR>";
}
if(!$$temail) {
$error .= "Missing Friends Email, Friend $num<BR>";
}
}
if($$temail) {
if(!ereg("@",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
if(!ereg("\.",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
}
}
if(!$tname) {
$error .= "Missing your name<BR>";
}
if(!ereg("@",$email)) { $error .= "Invalid Email Address<BR>"; }
if(!ereg("\.",$email)) { $error .= "Invalid Email Address<BR>"; }
if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC">
<TABLE WIDTH="400" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#0033CC">
<B><FONT COLOR="#ffffff" SIZE="-1" FACE="Tahoma">Error</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#ffffff">
<FONT COLOR="#000000" SIZE="-1" FACE="Tahoma"><?php echo $error; ?></FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
</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","
$then,
$message
Met vriendelijke groeten,
$name
","From: $name <$email>");
$youremail = "visie@beleggingsvisie.be";
$yoursubject = "Tell a friend werd gebruikt door: $name";
$yourmessage = "Tell a friend werd gebruikt door: $name
Friends email: $temail
Zenders email: $email
Zenders name: $name
Verzonden boodschap: $message";
$reply = "Van: $youremail";
mail($youremail,$yoursubject,$yourmessage,$reply);
}
}
exit();
} else {
$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#0033CC\">
<P><CENTER><B><FONT COLOR=\"#FFFFFF\" SIZE=\"-1\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#0033CC\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#0033CC\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}
?>
<P><CENTER><FONT FACE="Verdana" color="#0033CC" size="2"><B>Tell a friend</B></FONT></CENTER></P>
<FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD width= "60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw naam</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw e-mail</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><INPUT NAME="name" TYPE="text" SIZE="25"></CENTER></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<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="60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC"></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw vriend</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Zijn e-mail</FONT></B></CENTER></TD>
</TR><?php echo $theboxes; ?></TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Verzenden"></CENTER></FORM>
</BODY></HTML>
<?php
exit();
}
?>