My first php and a problem.

A

alfredo

Hi,

I got a php script for a "tell a friend form", tested it and everything went
fine. Then I adapted it to my site, tested and everything went fine again.
But suddenly the thing stopped working and I suppose it was me who
accidentally erased or changed something.

When I click on "submit" I get a "500 internal server error"

Here's the code in question:

html form:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Refer a friend to mysite</title>
</head>

<body>
<html>
<head>
<title>Refer a friend to mysite</title>
<script language="javascript">
<!--

function reset() {
document.refer.name.value="";
document.refer.email.value="";
document.refer.friendmail1.value="";
document.refer.friendmail2.value="";
}

function validate() {


if (document.refer.friendmail1.value.length==0) {
alert("please enter your friend's email address");
return false;
}

if (document.refer.email.value.length==0) {
alert("please enter your email address");
return false;
}
if (document.refer.name.value.length==0) {
alert("please enter your name");
return false;
}

document.refer.submit()
return true;
}

//-->
</script>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<center>
</center>
<table width="450" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center">

<form name="refer" action="refer.php" method="post" onsubmit="return
checkfields()">

<table border="0" width="370" cellspacing="0" cellpadding="2"
style="font-family: Verdana; font-size: 8pt">
<tr>
<td width="181">Your name:
</td>
<td width="181">Your email:</td>
</tr>
<tr>
<td width="181">
<input type="text" name="name" size="25"></td>
<td width="181">

<input type="text" name="email" size="25"></td>
</tr>
<tr>
<td width="366" colspan="2"> </td>
</tr>
<tr>
<td width="183">Friend's email</td>
<td width="183">Another friend's email</td>
</tr>
<tr>
<td width="183">
<input type="text" name="friendmail1" size="25"></td>
<td width="183">
<input type="text" name="friendmail2" size="25"></td>
</tr>
<tr>
<td width="366" colspan="2"> </td>
</tr>
<tr>
<td width="181" align="center">
<input type="submit" value="Submit" name="B3" style="font-family:
Verdana; font-size: 8pt"></td>
<td width="181" align="center">
<input type="reset" value="Reset" name="B4" style="font-family:
Verdana; font-size: 8pt"></td>
</tr>
</table></form>

</body>

</html>

------------------------------------------------------------------------------------------

php script: (of course mysite.com is not my real domain, I changed it,
didn't want to spam)

<?PHP



strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($email);
strip_tags($name);


$emailto = "(e-mail address removed)";

$esubject = "Page Referred";

$emailtext = "
".$name." / ".$email."

Referred People

".$friendmail1."
".$friendmail2."


";
@mail("$emailto", $esubject, $emailtext, "From: $email");


$thankyoupage = "thankyou.htm";

$tsubject = "A great site";

$ttext = "
Hi,

A friend or colleague of yours, ".$name.", whose email address is ".$email."
thought you may like to visit our site. ".$name." has used a form on
mysite.com to send you this email.

http://www.mysite.com
";
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM:
$email");


header("Location: $thankyoupage");
exit;
?>
 
T

Thomas A. Rowe

You need to contact your host, since this is internal server error.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top