KevinM1 Posted June 29, 2007 Share Posted June 29, 2007 I have a form which uses selection options as values to pass to the script which handles the data. Unfortunately, it looks like that second script isn't recognizing that an option is highlighted/selected in the first script at all. It's a setup that works like this: Form script: <?php echo "<form method='post' action='handler.php'>\n"; echo "<select>\n"; echo "<option name='all' value='*'>All</option>\n"; echo "<option name='1' value='1'>1</option>\n"; . . . echo "<option name='nth' value='nth'>nth</option></select></form>"; ?> handler.php: <?php if(isset($_POST['all'])){ //process stuff } ?> Obviously, this example is a bit simpler than what I'm doing, but it does accurately describe what I'm trying to attempt. Unfortunately, like I said above, it looks like my handler script isn't recognizing that whatever option I select is set (in other words, it looks like isset is failing). Any ideas? I will show the real code if necessary. Quote Link to comment https://forums.phpfreaks.com/topic/57761-solved-problem-using/ Share on other sites More sharing options...
melvincr Posted June 29, 2007 Share Posted June 29, 2007 you want the <select> as variable.. therefor you need to give it the name write: <select name="all">...blalblabla the <option> tags don't have names.. just values. (the value you choose will then be in the $_POST['all'] variable.. Quote Link to comment https://forums.phpfreaks.com/topic/57761-solved-problem-using/#findComment-286010 Share on other sites More sharing options...
KevinM1 Posted June 29, 2007 Author Share Posted June 29, 2007 you want the <select> as variable.. therefor you need to give it the name write: <select name="all">...blalblabla the <option> tags don't have names.. just values. (the value you choose will then be in the $_POST['all'] variable.. Ah, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/57761-solved-problem-using/#findComment-286017 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.