Re: dropdown Newbie question
| From: | Justin French | Date: | Thu, 05 Sep 2002 14:25:35 +0000 |
| Subject: | Re: dropdown Newbie question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115316@lists.php.net to get a copy of this message | ||
Why don't you take the guesswork out of it a bit, and NOT write to a file
just yet... instead, just echo the var to the screen. IF that works, then
we know it's not your form that is the problem, it's the exec().
Justin
on 06/09/02 12:08 AM, Mario Ohnewald (mario.ohnewald@gmx.de) wrote:
> Well, this is my original Code:
>
> ------------------
>
>
> // Theme
> echo '
> <form name="theme" action="options.php" target="right"
> class="menu"
> METHOD="POST">
> <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>';
>
> $var_from_dropdown = $_POST['theme'];
> exec("echo $var_from_dropdown > /tmp/varfromdropdown");
>
> ----------------
> The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty
> by
> the time i press the select button)
>
> Any other ideas?
>
>
>
>> From: Jay Blanchard [mailto:jay.blanchard@niicommunications.com]
>>
>>
>> [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
>