troubleshooting Question

Simple form not working after upgrading to php5

Avatar of wraithlord
wraithlord asked on
15 Comments1 Solution368 ViewsLast Modified:
I have this very simple contact form on one of my sites and after upgrading the servers to php5 they do not work anymore. I have attached the code. Thank you in advance.

  if ($REQUEST_METHOD == "POST") {
	$comments = ($comments);
	$from = ($email);
	$sendto = "";
	$subject = "Feed Back From You Website";
	$message = "$comments";
	mail($sendto, $subject, $message, $from); 
	header("Location: index.htm"); 	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Site Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<div id="header">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <td width="200" height="68" align="center" bgcolor="#F68B1F"><img src="images/home_logo.gif" width="191" height="29"></td>
      <td width="7" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="middle" bgcolor="#000000"><img src="images/indications_logo.gif" alt="Indications" width="191" height="29"></td>
      <td align="right" valign="middle" bgcolor="#000000"><img src="images/address.gif" alt="Address" width="200" height="68"></td>
<div id="nav"><a href="index.htm" target="_self" class="nav">Home</a> <a href="resume.htm" target="_self" class="nav">BIO</a> <a href="index.htm" target="_self" class="nav">Portfolio </a><a href="contact.php" target="_self" class="nav">Contact </a></div>
<div id="content">
  <form action="<?php echo("$script_name"); ?>" method="post">
    Your Name:<br>
  <input name="name" type="text" id="name" style="width:200px; height:20px; border-width:1px; border-style:solid; border-color:#575757; background-color:#D0D8DA ">
  <img src="images/spacer.gif" height="15	px"><br>
  <input name="email" type="text" id="email" style="width:200px; height:20px; border-width:1px; border-style:solid; border-color:#575757; background-color:#D0D8DA ">
  <img src="images/spacer.gif" height="15px"><br>
  <textarea name="comments" id="comments" style="width:200px; height:150px; border-width:1px; overflow:auto; border-style:solid; border-color:#575757; background-color:#D0D8DA "></textarea>
  <input name="image" type="image" src="images/reset.gif">
    <input name="image" type="image" style="margin-left:15px " src="images/submit.gif">
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 15 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros