Hi all Developers,
Plz help me get through this problem...
I have the following tell a freind script..
<?php
// number of friend feilds to put on the page
$tellnumber = "4";
// subject of email
$subject = "I just found a cool site";
// Message sent in the email
$message = "Checkout this cool site i found http://www.DalilKom.com";
// url to redirect user to once they click submit
$thankyouurl = "http://www.DalilKom.com";
//////////////////////////////////////////////////////////////////////////////////
// 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 .= "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) {
echo("<P><CENTER><FONT FACE=\"Verdana\">Tell your friend about our site</FONT></CENTER></P>
<P><CENTER> </CENTER></P><P><CENTER><TABLE BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=\"#004080\">
<TABLE WIDTH=\"394\" BORDER=\"0\" CELLSPACING=\"6\" CELLPADDING=\"2\">
<TR>
<TD WIDTH=\"26%\" BGCOLOR=\"#004080\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">Error</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH=\"26%\" BGCOLOR=\"#000000\">
<FONT COLOR=\"#cccccc\" SIZE=\"-1\" FACE=\"Verdana\">$error</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER><P><CENTER> </CENTER></P><P><CENTER> </CENTER></P><P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/tellfriend.php\">Tell Friend</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\">PHPScriptCENTER.com</A></FONT></CENTER></P>");
exit();
}
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
$then = $$tname;
if($$temail AND $$tname) {
mail($$temail,"$subject","
Hi, $then
$message
From
$name
Powerd by Tell Friend v1.0
Get a free copy from http://www.phpscriptcenter.com
","From: $name <$email>");
}
}
header("Location: $thankyouurl");
} else {
$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#000000\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#000000\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#000000\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}
echo("<P><CENTER><FONT FACE=\"Verdana\">Tell Your Friends About DalilKom®</FONT></CENTER></P>
<P><CENTER> </CENTER></P><FORM ACTION=\"tellfriend.php\" METHOD=\"POST\"><P><CENTER><TABLE BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=\"#004080\">
<TABLE WIDTH=\"394\" BORDER=\"0\" CELLSPACING=\"6\" CELLPADDING=\"2\">
<TR>
<TD WIDTH=\"26%\" BGCOLOR=\"#004080\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">Your
Name</FONT></B></CENTER></TD>
<TD WIDTH=\"25%\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">Your
Email</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH=\"26%\" BGCOLOR=\"#000000\">
<P><CENTER><INPUT NAME=\"name\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#000000\">
<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=\"#004080\">
<TABLE WIDTH=\"394\" BORDER=\"0\" CELLSPACING=\"6\" CELLPADDING=\"2\">
<TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#004080\"></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#004080\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">Friends
name</FONT></B></CENTER></TD>
<TD WIDTH=\"25%\">
<P><CENTER><B><FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">Friends
email</FONT></B> </CENTER></TD>
</TR>$theboxes</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME=\"submitform\" TYPE=\"submit\" VALUE=\"Submit\"></CENTER></FORM><P><CENTER> </CENTER></P><P><CENTER> </CENTER></P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/tellfriend.php\">Tell Friend</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\">PHPScriptCENTER.com</A></FONT></CENTER></P>");
}
php?>
================================
it works fine, but when I add the followinf code at the begining:
<html dir="rtl">
<head>
<meta name="ProgId" content="FrontPage.Editor.Document">
$thankyouurl<title>dalilkom</title>
</head>
when I push the submit button,I get an error msg:
Warning: Cannot add header information - headers already sent by (output started at /home/dalilkom/public_html/tellfriend.php:8) in /home/dalilkom/public_html/tellfriend.php on line 103
any help?
thanx a lot...
sorry if it's too long