sendmail script not working, HELP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gammaman
Forum Commoner
Posts: 45
Joined: Tue Feb 12, 2008 9:22 am

sendmail script not working, HELP

Post by gammaman »

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

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"/>
&nbsp
<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/>
&nbsp &nbsp &nbsp &nbsp &nbsp
<input type = "submit" value="send">
<input type = "reset"  value="clear">
</form>
</div>
</body>
</head>
</html>
 
 
Here is the php script

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");
?> 
 
kishanprasad
Forum Newbie
Posts: 16
Joined: Mon Feb 25, 2008 5:20 pm

Re: sendmail script not working, HELP

Post by kishanprasad »

if ur running ur php page what u have shown in the server put the page where u want to redirect also in ther server i mean 'www'

if u want to test only the o/p no need of putting that in the server u can check the design witha normal html
Post Reply