I am not sure if this is a problem in the HTML, or in the PHP. Thank you for taking a look, and I appreciate any pointers anyone has as to why this is not working:
HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <h1>Customer Feedback</h1> <p>Please tell us what you think.</p> <form action="processfeedback.php" method="post" name="feedback"> <p>Your name:<br /><input name="name" type="text" size="45" maxlength="45" /> </p> <p>Your email address:<br /><input name="email" type="text" size="45" maxlength="45" /> </p> <p>Your feedback:<br /><textarea name="feedbacktext" cols="45" rows="8"></textarea> </p> <p><input name="submit" type="button" value="Submit Feedback" /> </p> </form> </body> </html>
PHP page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php //create short variable names $name = $_POST['name']; $email = $_POST['email']; $feedback = $_POST['feedbacktext']; //set up some static info $toaddess = "feedback@example.com"; $subject = "Feedback from website"; $mailcontents = "Customer name: ".$name."\n"."Customer email: ".$email."\n"."Customer comments: \"".$feedback."\"\n"; $fromaddress = "webserver@feedback.com"; //invoke mail() function to send mail mail($toaddress, $subject, $mailcontents, $fromaddress); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bob's Auto Parts - Feedback submitted</title> </head> <body> <h1>Feedback Submitted</h1> <p>Your feedback has been sent</p> </body> </html>
EDIT: I forgot the code would not show it, but the script is named "processfeedback.php", as the HTML page requires.


Sign In
Create Account


Back to top









