croakingtoad Posted June 29, 2007 Share Posted June 29, 2007 I have a page that submits to itself and I'm trying to detect the submit post but it's not working. I'm not sure what's going on here...can someone help? Here's the code-- <? if ($_POST['Submit']) { $thanks = "Thank you for your inquiry. We will be in touch. If you have any questions in the interim, please feel free to contact us."; } //HTML head removed <body> <? echo $thanks; ?> <form action="bedside-manner.php" name="form1"> //form contents <input type="submit" value="Submit" name="Submit" /> </form> </body> </html> You can view this in action here-- http://www.ourhealthswva.com/bedside-manner.php Thanks in advance. Quote Link to comment Share on other sites More sharing options...
no_one Posted June 29, 2007 Share Posted June 29, 2007 use isset() if ( isset($_POST['submit']) ) { } Quote Link to comment Share on other sites More sharing options...
croakingtoad Posted June 29, 2007 Author Share Posted June 29, 2007 Tried that...didn't work...? Something else must be wrong? Quote Link to comment Share on other sites More sharing options...
no_one Posted June 29, 2007 Share Posted June 29, 2007 looks like you're missing a ?> closing tag after the if.. probably just a typo for the example though. Try adding post as your form method. I cannot remember really, but forms might default to GET otherwise. Good to get into this habit anyway. <form action="..." method="post" > </form> Quote Link to comment Share on other sites More sharing options...
croakingtoad Posted June 29, 2007 Author Share Posted June 29, 2007 That was it. Left out the method. It's too late to be forgetting my html Thanks so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.