dewey_witt Posted July 27, 2007 Share Posted July 27, 2007 Ok so i have a form that sends an email with the link to my site to a visitors friend. The mail sends fine but... im getting this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Here is the form: <form action="Send_Link.php" method="post" enctype="multipart/form-data" name="Link" target="_blank"> <table><center> <tr><td colspan="2">Send a friend<br /> a link To<br /> EzSellNow.com</td></tr> <tr><td>Your Full Name:</td><td><input name="FullName" type="text" size="25" maxlength="35" /></td></tr> <tr><td>Your Friends Name:</td><td><input name="FriendName" type="text" size="25" maxlength="35" /></td></tr> <tr><td>Your Frinds Email:</td><td><input name="Email" type="text" size="35" /></td></tr> <tr><td colspan="2"><input name="submit" type="submit" value="Send The Link!" /></td></tr> </center></table> </form> and here is the mail(): <?php error_reporting(0); $msg = "We wou like you to come see our site!\nThis is why:\n\n"; $msg .= "Your friend " . $_POST[FullName] . " thought you might like Somewhere.com\n"; $msg .= "So comeon " . $_POST[FriendName] . " and join us now!\n"; $msg .= "Someplace.com is a site for investors and people\n who want to sell their homes quickly\n"; $msg .= "So what are you waiting on?\n Come see what you friend is talking about!\n"; $to = . $_POST[Email] .; $subject = "Your friend " . $_POST[FullName] . " wants you to check this out!"; $headers = "From: register@Somewhere.com\n"; $headers .= "Reply-To: noreply@Somewhere.com\n\n"; mail($to, $subject, $msg, $headers); echo "Thanks For Telling Your Friend About Us!"; ?> Any help on the matter would be well apriciated Thanx in advance! Quote Link to comment Share on other sites More sharing options...
dewey_witt Posted July 27, 2007 Author Share Posted July 27, 2007 Noone? ??? Quote Link to comment Share on other sites More sharing options...
Adrianphp Posted July 27, 2007 Share Posted July 27, 2007 and here is the mail(): 1. use $_POST as array... example: try $_POST['FullName'] instead of $_POST[FullName] 2. $to = . $_POST .; rewrite to $to = $_POST['Email']; 3. remove error_reporting(0); to see exactly the errors or 4. check PHP log. Quote Link to comment Share on other sites More sharing options...
LiamProductions Posted July 27, 2007 Share Posted July 27, 2007 I found some errors: <?php $msg = "We wou like you to come see our site!\nThis is why:\n\n"; $msg .= "Your friend " . $_POST['FullName'] . " thought you might like Somewhere.com\n"; $msg .= "So comeon " . $_POST['FriendName'] . " and join us now!\n"; $msg .= "Someplace.com is a site for investors and people\n who want to sell their homes quickly\n"; $msg .= "So what are you waiting on?\n Come see what you friend is talking about!\n"; $to = . $_POST['Email'] .; $subject = "Your friend " . $_POST['FullName'] . " wants you to check this out!"; $headers = "From: register@Somewhere.com\n"; $headers .= "Reply-To: noreply@Somewhere.com\n\n"; mail($to, $subject, $msg, $headers); echo "Thanks For Telling Your Friend About Us!"; ?> Quote Link to comment Share on other sites More sharing options...
ignace Posted July 27, 2007 Share Posted July 27, 2007 LiamProductions means he fixed some errors.. forgot the $to issue though so here it is with all errors fixed according to adrianphp <?php error_reporting(E_ALL); $msg = "We would like you to come see our site!\nThis is why:\n\n"; $msg .= "Your friend " . $_POST['FullName'] . " thought you might like Somewhere.com\n"; $msg .= "So comeon " . $_POST['FriendName'] . " and join us now!\n"; $msg .= "Someplace.com is a site for investors and people\n who want to sell their homes quickly\n"; $msg .= "So what are you waiting for?\n Come see what your friend is talking about!\n"; $to = $_POST['Email']; $subject = "Your friend " . $_POST['FullName'] . " wants you to check this out!"; $headers = "From: register@Somewhere.com\n"; $headers .= "Reply-To: noreply@Somewhere.com\n\n"; if (mail($to, $subject, $msg, $headers)) { echo "Thanks For Telling Your Friend About Us!"; } else { // mail not send... } ?> more about mailing in php: http://www.php.net/manual/en/ref.mail.php Quote Link to comment Share on other sites More sharing options...
dewey_witt Posted July 27, 2007 Author Share Posted July 27, 2007 Thanks for all your help Peoples I appriciate it! I had gotten it figured out befor i read you post. But yeah you both saw my errors lol 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.