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. Link to comment https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/ Share on other sites More sharing options...
no_one Posted June 29, 2007 Share Posted June 29, 2007 use isset() if ( isset($_POST['submit']) ) { } Link to comment https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/#findComment-285449 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? Link to comment https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/#findComment-285451 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> Link to comment https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/#findComment-285455 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! Link to comment https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/#findComment-285459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.