RE: [PHP] dropdown Newbie question
| From: | Jay Blanchard | Date: | Thu, 05 Sep 2002 12:50:40 +0000 |
| Subject: | RE: [PHP] dropdown Newbie question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115300@lists.php.net to get a copy of this message | ||
[snip]
// Theme
echo '
<form name="theme" action="options.php" target=right class=menu>
<select name="theme">';
for($i=0;$i<sizeof($theme_name);$i++)
{
echo "<option
value='".$i."'>".$theme_name[$i]."</option>\n";
}
echo '</select> <input type=submit name=get value=select
METHOD=POST>';
// or:
echo '</select> <input type=submit name=get value=select
METHOD="POST">';
$var_from_dropdown = $_POST['theme'];
exec("echo $var_from_dropdown > /tmp/varfromdropdown");
the exec line seems to works since it created the file. But it stays emty.
[/snip]
You need to place METHOD=POST in the original form tag and remove it from
the submit tag. Try that
HTH!
Jay
*****************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* Contact jay.blanchard@niicommunications.com *
* *
* Want to present a paper or workshop? Contact now! *
*****************************************************