achilles1971 Posted November 18, 2012 Share Posted November 18, 2012 Here is my form: <FORM action="eatnlocal_validate.php" method="post"> <P> Name: <INPUT type="text" id="name"><BR> Restaurant name: <INPUT type="text" id="restaurant"><BR> Email: <INPUT type="text" id="email"><BR> <input type="submit" value="Submit" name="submit"> </P> </FORM> Here is my eatnlocal_validate.php: <?php if (isset($_POST['name']) && isset($_POST['restaurant']) && isset($_POST['email'])){ $name = $_POST['name']; $restaurant = $_POST['restaurant']; $email = $_POST['email']; header("Location: info_ad.php"); } else{ echo "Please enter all information. Click "?><a href = "info_form.php">Here</a><?php echo" to go back."; } ?> When I enter info into all three fields, I still get the else function. What am I doing wrong? Thanks Link to comment https://forums.phpfreaks.com/topic/270851-_post-variable-doesnt-seem-to-so-what-i-want/ Share on other sites More sharing options...
MMDE Posted November 18, 2012 Share Posted November 18, 2012 You need to specify a name attribute for the input tags... <form action="eatnlocal_validate.php" method="post"> <P> Name: <input type="text" id="name" name="name"><br> Restaurant name: <input type="text" id="restaurant" name="restaurant"><br> Email: <input type="text" id="email" name="email"><br> <input type="submit" value="Submit" name="submit"> </P> </form> and you don't really need to use id, unless it has something to do with your CSS or something... Link to comment https://forums.phpfreaks.com/topic/270851-_post-variable-doesnt-seem-to-so-what-i-want/#findComment-1393338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.