Jump to content

[SOLVED] Problem using <select>


KevinM1

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/57761-solved-problem-using/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.