$_POST not working with simple form

php, post

Solution

You have repeating post in might be what's making it act up. Try changing your form name to something else. Also, try to get rid of the extra spaces around the = signs.

Problem

Don't really know why this is, but my simple PHP form is not working with the $_POST variable, returning an error. HTML form: ``` <form name = "post" action = "insert_into.php" method = "post"> <p><label for="author">Author:</label></p><input type = "text" id = "author" name = "author"> <p><label for="subject">Subject:</label></p><input type = "text" id = "subject" name = "subject"> <p><label for="content">Content:</label></p><textarea id = "content" rows = "8" cols = "40" name = "content"></textarea> <br /> <input type = "submit"> </form> ``` PHP processing script: ``` $subject = $_POST['subject'];//line 7 $author = $_POST['author'];//line 8 $content = $_POST['content'];//line 9 $date = date("d/m/Y"); ``` Error: ``` Notice: Undefined index: subject in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 7 Notice: Undefined index: author in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 8 Notice: Undefined index: content in E:\_temp\xampp\htdocs\sxp\insert_into.php on line 9 ```

Original source