Issue with post data not received in a php page
Posted
by jul
on Stack Overflow
See other posts from Stack Overflow
or by jul
Published on 2010-06-17T15:36:34Z
Indexed on
2010/06/17
16:03 UTC
Read the original article
Hit count: 162
hi,
I created a page in Wordpress (http://www.exam-vision.com/testmail) that sends POST data to itself in order to send an email. The code is shown below. While it seems that data are sent properly, it seems that they are not received since isset($_REQUEST['email']) is always false. Anybody could help?
Thanks
Jul
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
echo "isset email is true";
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( "[email protected]", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action=''>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
© Stack Overflow or respective owner