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") { 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? 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 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 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 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 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
Archived
This topic is now archived and is closed to further replies.