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> Quote 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'])) { ?> Quote 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! Quote 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? Quote 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" ??? Quote 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 Quote 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 ? Quote 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> Quote 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/87051-solved-quick-submiting-problem/#findComment-445243 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.