Jump to content

[SOLVED] Server Error


dewey_witt

Recommended Posts

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!

Link to comment
Share on other sites

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!";

?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.