Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

where is my message ?

Contributor ,
Jan 20, 2007 Jan 20, 2007
hey again. i had this problem before and Arandlett helped me out in here, but i created a new form and got into a the same
problem.

i created this form : feedback.html

<!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=iso-8859-1" />
<title>Feedback Form</title>
</head>
<body>
Meanwhile, please feel free to submit any suggestions <br />
or ideas to make this website fun for everyone: <br />

<form action="handle_form.php"method="post">



Name: <input type="text" name="name" size="20" />
<br />
Email Address: <input type="text" name="email" size="20" />
<br />
Your Message: <textarea name="Your message" rows="3" cols="30"></textarea>
<br />
<input type="submit" name="submit" value="Hit me" />

</form>

<!-- Script 3.3 - feedback.html -->
</body>
</html>



i created this form : feedback.html

and this is the browser where it goes to : handle_form.php

<!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=iso-8859-1" />
<title>Your Feedback</title>
</head>
<body>
<?php // Script 3.4 - handle_form.php

// This page receives the data from feedback.html.
// It will receive: tittle, name, email, response, comments, and submit.
print "Thank you $title $name for your
time. <br />";
print "Any suggestions or comments would be appreciative. We will respond to any emails given.
$your_message";

// gets the variables from the form

$title = $_POST['title'];
$name = $_POST['name'];
$email = $_POST['email'];
$response = $_POST['response'];
$your_message = $_POST['your_message'];


// type the subject of the email you will receive below

$emailSubject = "Feedback";

// variables from form placed into the body of the email with html break tags and labels so your email makes sense

$emailBody = "Name: $name <br/> Your Message: $your_message";

$emailTo = "webmaster@therainbowpride.com";

//sets the users email to the from email
$emailFrom = $email;

//sets the header info for the email
$emailHeader = "From: $emailFrom\r\n"
. "MIME-Version: 1.0\r\n"
. "Your_Message-type: text/plain; charset=\"ISO-8859-1\"\r\n"
. "Content-transfer-encoding: 8bit\r\n";

// emails the information
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
?>
</body>
</html>


The only problem i have is that when people fill the form and submit it, it goes to my email but, i see everything but the message they wrote.

Thanks guys. i really appreciate the help

TOPICS
Server side applications
221
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 20, 2007 Jan 20, 2007
Your form text area is called Your_message, but youre populating the
$your_message variable with $_POST['your_message']

Note the text area starts with Y and the post variable your looking at has a
lowercase y, so these are mismatched. Fix that and it should work.


--
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 20, 2007 Jan 20, 2007
LATEST
Thank you so much, i cannot believe i missed the Y's lol. Thanks so much, its working fine now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines