returntherake Posted October 16, 2010 Share Posted October 16, 2010 Hi, I recently attempted to install a refer-a-friend script into my website but I really don't use PHP at all and even my html is very sloppy so it didn't get installed as planned. It currently cuts out the bottom half of my website like so: http://www.returntherake.com/refer.php Basically everything before the script is called is fine but everything after doesn't work. Heres the code from the point its installed till the end of my website. Any help would be great. Thank you so much. <script language="php"> // Number of friend feilds to put on the page $tellnumber = "3"; // Subject of email $subject = "Great Poker Rakeback Site"; // Message sent in the email $message = "Look at this great site I found. I think you'll like it. It will boost your profits while playing online poker by getting you some of your rake back. http://www.ReturnTheRake.com/ When signing up with a website remember to say $_POST[name] referred you in the proper section. As you will recieve a 25% bonus on your first $20 rakeback recieved."; // Url to redirect user to once they click submit $thankyouurl = "http://www.returntherake.com/thankyou_refer.html"; ////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT ANYTHING BELOW THIS LINE // ////////////////////////////////////////////////////////////////////////////////// if($_POST[submitform] == "Submit") { $error = ""; $num=0; while($num < $tellnumber) { $num++; $temail = "femail"."$num"; $tname = "fname"."$num"; if($_POST[$tname] OR $_POST[$temail]) { if(!$_POST[$tname]) { $error .= "Missing Friends Name, Friend $num<BR>"; } if(!$_POST[$temail]) { $error .= "Missing Friends Email, Friend $num<BR>"; } } if($_POST[$temail]) { if(!ereg("@",$_POST[$temail])) { $error .= "Invalid Email Address, Friend $num<BR>"; } if(!ereg("\.",$_POST[$temail])) { $error .= "Invalid Email Address, Friend $num<BR>"; } } } if(!$_POST["name"]) { $error .= "Missing your name<BR>"; } if(!ereg("@",$_POST)) { $error .= "Invalid Email Address<BR>"; } if(!ereg("\.",$_POST)) { $error .= "Invalid Email Address<BR>"; } if($error) { ?> <BODY BGCOLOR="#ffffff"> <P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="26%" BGCOLOR="#01864E"> <B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Error</FONT></B></TD> </TR> <TR> <TD WIDTH="26%" BGCOLOR="#ffffff"> <FONT COLOR="#000000" SIZE="-3" FACE="Verdana"><? echo $error; ?></FONT></TD> </TR> </TABLE></TD> </TR> </TABLE></CENTER> <? exit(); } $extra ="\r\n"; $headers = ""; $headers .= "From: $_POST[name] <$_POST>".$extra; $headers .= "Reply-To: $_POST[name] <$_POST>".$extra; $headers .= "Return-Path: $_POST[name] <$_POST>".$extra; $headers .= "Message-ID: <".time()." - $_POST>".$extra; $headers .= "X-Mailer: PHP v".phpversion().$extra; $headers .= 'MIME-Version: 1.0'.$extra.$extra; $num=0; while($num < $tellnumber) { $num++; $temail = "femail".$num; $tname = "fname".$num; $print_f_name = $_POST[$tname]; $print_f_email = $_POST[$temail]; if($_POST[$temail] AND $_POST[$tname]) { mail($print_f_email,"$subject"," Hi, $print_f_name $message From $_POST[name] ",$headers); } } header("Location: $thankyouurl"); exit(); } else { $num=0; while($num < $tellnumber) { $num++; $theboxes .= " <TR> <TD WIDTH=\"49%\" BGCOLOR=\"#ffffff\"> <CENTER><B><FONT COLOR=\"#000000\" SIZE=\"-3\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD> <TD WIDTH=\"26%\" BGCOLOR=\"#ffffff\"> <CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"-3\"></CENTER></TD> <TD WIDTH=\"25%\" BGCOLOR=\"#ffffff\"> <INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"-3\"> </TD> </TR>"; } ?> <BODY BGCOLOR="#ffffff"> <P><CENTER><FONT FACE="Verdana"><B>Tell your friend about our site</B></FONT></CENTER></P> <FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="26%" BGCOLOR="#01864E"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Your Poker Account</FONT></B></CENTER></TD> <TD WIDTH="25%"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Your Email</FONT></B></CENTER></TD> </TR> <TR> <TD WIDTH="150" BGCOLOR="#ffffff"> <CENTER><INPUT NAME="name" TYPE="text" SIZE="12px"></CENTER></TD> <TD WIDTH="200" BGCOLOR="#ffffff"> <INPUT NAME="email" TYPE="text" SIZE="-3"> </TD> </TR> </TABLE></TD> </TR> </TABLE></CENTER></P><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="49%" BGCOLOR="#01864E"></TD> <TD WIDTH="26%" BGCOLOR="#01864E"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Friends name</FONT></B></CENTER></TD> <TD WIDTH="25%"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Friends email</FONT></B></CENTER></TD> </TR><? echo $theboxes; ?></TABLE></TD> </TR> </TABLE></CENTER></P> <P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Submit"></CENTER></FORM> <? exit(); } ?> </h3> </td> </tr> </table></td> <td width="1" bgcolor="#CCCCCC"></td> </tr> <tr> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="10" align="center" valign="top"></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td align="left" height="17" valign="top" class="style19"> </td> </tr> <tr> <td align="left" height="17" valign="top" class="style19"> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td align="left" valign="top" width="11"><img src="images/footer_bg_left.gif" alt="" height="120" width="11" /></td> <td class="footer" align="left" valign="middle"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td style="padding-left: 12px;" align="left" valign="top" width="260"><img src="images/footer_img.gif" alt="" height="110" width="249" /></td> <td align="left" valign="middle"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td class="footer_border" align="left" valign="top"> <a href="index.php">Homea> | <a href="#">Terms & Conditions</a> | <a href="#"> Privacy Policy</a> | <a href="#">Site Map</a> | <a href="#">Contact Us</a></td> </tr> <tr> <td class="footer_border" style="font-size: 10px; line-height: 22px;" align="left" valign="top">ReturnTheRake.com Copyright © 2010, All Rights Reserved.</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> <td align="left" valign="top" width="11"><img src="images/footer_bg_right.gif" alt="" height="120" width="11" /></td> </tr> </tbody> </table> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> </tbody> </table> <br /> </body> </html> Quote Link to comment Share on other sites More sharing options...
herghost Posted October 17, 2010 Share Posted October 17, 2010 1st of all, wherever you see a <? change this to <?php, short open tags are deprecated and this could be the cause, let us know what happens Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2010 Share Posted October 17, 2010 deprecated doesn't mean "no longer supported." Short tags should work fine as long as they are turned on in php.ini. But I highly doubt short tags is the problem. The problem is more likely the use of this line: <script language="php"> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 17, 2010 Share Posted October 17, 2010 Perhaps if you were to remove exit(); . . . Especially since that is precisely where the output stops. Quote Link to comment Share on other sites More sharing options...
returntherake Posted October 19, 2010 Author Share Posted October 19, 2010 I changed the <? to <?php no change. Quote Link to comment Share on other sites More sharing options...
returntherake Posted October 19, 2010 Author Share Posted October 19, 2010 haha wow I'm dumb removed the exit and it worked prefect... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.