jeudi 9 avril 2015

PHP not getting POST information

I am trying to get user feedback emailed to me using the PHP mail() function. Here is my code:



<form method="post" action="#" onsubmit="return false" name="form">
<table>


<tr>
<td>Your email:</td> <td><input required type="text" name="youremail" placeholder="email@email.com"></td>
</tr>
<tr>
<td>Your message: </td><td><textarea rows="30" cols="40" name="message" style="vertical-align:top;"></textarea></td>
</tr>
<tr><td>
<input type="submit" name="submit">
</td></tr>
</table>
</form>


<?php

$to = "email@email.com";

$message = $_POST["message"];

mail($to, 'Feedback', $message);

?>


The message is sent, but there is nothing in the body of the email. I've tested it, and it doesn't work.


Aucun commentaire:

Enregistrer un commentaire