DeepSeek π€ Posted May 5, 2009 Share Posted May 5, 2009 what is the equivelant to php 4s Β <form method=post action=file.php?action=1234> <input type=submit value=Clear name=clear> </form> Β <?php Β if($action == 1234) { print"hi"; } ?> and the website would be something like www.xxx.com/file.php?action=1234 Β that wouldnt work in php 5 but it does in php 4. Β I know in php 5 it would be something using $_POST or $_GET but im not to keen these. Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/ Share on other sites More sharing options...
Gemini π€ Posted May 5, 2009 Share Posted May 5, 2009 Try this, should be pretty self explanatory, but if you have questions please ask: Β </pre> <form method="GET" action="file.php?action=1234"> </form> <br><br><br>if($_GET['$action'] == 1234)<br>{<br>Β print"hi";<br>}<br Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826915 Share on other sites More sharing options...
Merlin π€ Posted May 5, 2009 Share Posted May 5, 2009 Wouldn't it just be simpler to type the action in the URL rather than that form? Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826920 Share on other sites More sharing options...
Grok π€ Posted May 5, 2009 Share Posted May 5, 2009 Form method POST and you want to get something via GET method ? Why ? If you want to get something from URL, use GET - if you want to get something from somewhere ( buffer ), use POST. As simple as thatΒ Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826921 Share on other sites More sharing options...
Gemini π€ Posted May 5, 2009 Share Posted May 5, 2009 Wouldn't it just be simpler to type the action in the URL rather than that form? Β Guess we won't know until he elaborates on his application first. Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826929 Share on other sites More sharing options...
DeepSeek π€ Posted May 5, 2009 Author Share Posted May 5, 2009 ok, i mean in php 4 you could use Β say there was a form at the link www.xxx.com/link.php and it brought you to that same page but with ?action=1234 that said name: "bob"Β as what you typed in and the name was "name" if ($action == 1234) { print"$name"; exit; } Β and on the website it would say bob Β but in php 5 it doesnt work Β Β Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826935 Share on other sites More sharing options...
Grok π€ Posted May 5, 2009 Share Posted May 5, 2009 PHP4 is historyΒ Anyways, problem solved ? Quote Link to comment https://forums.phpfreaks.com/topic/156981-form-submitting/#findComment-826936 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.