andrewgarn Posted July 3, 2008 Share Posted July 3, 2008 Ok well i have a drop down box which needs to set post or get data to the same page. <form name="skill" method="get" action="ranking.php"> <SELECT onchange=submit() NAME="view"> <OPTION VALUE="op1">op1</OPTION> <OPTION VALUE="op2">op2</OPTION> </SELECT> This reloads the same page with this in the address bar: ranking.php?view=op1 how do i change it so the page recognises the address bar variable and uses it here: if(isset($_GET["cmd"])) { if($_GET["cmd"]=="view" || $_POST["cmd"]=="view") { Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/ Share on other sites More sharing options...
DeanWhitehouse Posted July 3, 2008 Share Posted July 3, 2008 change that to if(isset($_GET["view"])) { if($_GET["view"]=="op1") { is this what u want? Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/#findComment-580971 Share on other sites More sharing options...
andrewgarn Posted July 3, 2008 Author Share Posted July 3, 2008 That works thanks, but its not hiding the original data, what do i need to have at the beginning? I should know this....i guess i'm tired. if(!isset($_GET["skill"])) { doesnt work Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/#findComment-580985 Share on other sites More sharing options...
DeanWhitehouse Posted July 3, 2008 Share Posted July 3, 2008 exit(); ?? put that at the end of the get code Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/#findComment-580986 Share on other sites More sharing options...
andrewgarn Posted July 3, 2008 Author Share Posted July 3, 2008 No i'm talking rubbish it works fine Sorry Thanks Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/#findComment-580987 Share on other sites More sharing options...
libertyct Posted July 3, 2008 Share Posted July 3, 2008 i really wanna help but i dont understand what you want to do Quote Link to comment https://forums.phpfreaks.com/topic/113102-solved-drop-down-submit-getpost/#findComment-580990 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.