j33baS Posted January 21, 2008 Share Posted January 21, 2008 Hi, this is a simplified script of something i'm trying to do ... (still pretty new to php) if i click the "go" button, the page reloads, should'nt "submit" be recognised and "sumthing submitted" displayed ? <?php if ($_POST['submit']) { echo "sumthing submitted"; } else { echo "nothing submitted"; } ?> <form> <input type="submit" name="submit" value="Go" method="post"> </form> Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/ Share on other sites More sharing options...
PHP Monkeh Posted January 21, 2008 Share Posted January 21, 2008 Try: <?php if (isset($_POST['submit'])) { ?> Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445173 Share on other sites More sharing options...
j33baS Posted January 21, 2008 Author Share Posted January 21, 2008 hmmm still doesn't work! Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445180 Share on other sites More sharing options...
revraz Posted January 21, 2008 Share Posted January 21, 2008 Does it echo nothing submitted or does it just not echo anything? Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445186 Share on other sites More sharing options...
j33baS Posted January 21, 2008 Author Share Posted January 21, 2008 yea it just echoes 2nothing submitted" ??? Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445194 Share on other sites More sharing options...
revraz Posted January 21, 2008 Share Posted January 21, 2008 What version of PHP? Hopefully it's not too old and supports POST Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445202 Share on other sites More sharing options...
j33baS Posted January 21, 2008 Author Share Posted January 21, 2008 its 5.2.5, why does that look like it should work to you ? Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445214 Share on other sites More sharing options...
revraz Posted January 21, 2008 Share Posted January 21, 2008 You have method on the wrong line <form method="post"> <input type="submit" name="submit" value="Go"> </form> Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445217 Share on other sites More sharing options...
j33baS Posted January 21, 2008 Author Share Posted January 21, 2008 ahh thanks again revraz ! Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.