sendmail script not working, HELP
Posted: Wed Apr 02, 2008 3:24 pm
I have a form and a sendmail script and when I click send to email the form the browser brings up the dreaded "The page cannot be dsiplayed". I have a few questions, first, can I run my script off of the wamp localhost, b/c I only need to demo the form, not run it on a webhost.
Secondly, I want to make sure that my code is ok, and need help as to why it is not working.
Here is the html form
Here is the php script
Secondly, I want to make sure that my code is ok, and need help as to why it is not working.
Here is the html form
Code: Select all
<html>
<head>
<style type ="text/css">
div#wrap{
margin:0 auto;
width:400px;
</style>
<body>
<div id="wrap">
<FORM METHOD = "post" action="http://localhost/sendmail.php">
First Name:
<input type ="text" name="firstname"/>
 
<br/>
Last Name:
<input type ="text" name="lastname"/>
<br/>
<br/><dd/>
Comments orSuggestions:
<br/><dd/>
<textarea name="comment" rows="10" cols="50"></textarea>
</textarea>
<br/>
         
<input type = "submit" value="send">
<input type = "reset" value="clear">
</form>
</div>
</body>
</head>
</html>
Code: Select all
<?php
$first = $_REQUEST['firstname'];
$last = $_REQUEST['lastname'];
$comment = $_REQUEST['comment'];
mail("code.bro@verizon.net", "Comments/Suggestions",
"From: $first,$last", "Comment:$comment");
header("Location:E:/Senior Project/cater.html");
?>