forms - PHP not getting POST information -


i trying user feedback emailed me using php mail() function. here 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 sent, there nothing in body of email. i've tested it, , doesn't work.

you should put error logging on, see this:

notice: undefined index: message in xxxx on line 22

also you're not sending form: onsubmit="return false"

make sure check if variables set also, isset() function.


Popular posts from this blog