|
Posted by Aaron Greenspan on 08/13/05 19:30
Hi,
There are a couple of problems with your code. The first is that you
have global variables enabled, which makes things easier, but also makes
things less secure. You should definitely disable them in your php.ini
file if possible.
Also, when you put the square brackets after gmev (gmev[]), you turn
$_POST['gmev'] into an array. Yet your code just checks to see if the
$_POST['gmev'] variable has any value at all, which of course, it does.
> if ($gmev) {
> $checked = ' checked="checked"';
> } else {
> $checked = '';
> }
Therefore, when you go to present the form, $checked always has the
string from the first case in the if statement, since you're not
specifying which part of the $gmev array you really care about.
My suggestion to everyone dealing with these form problems, which are a
general pain... Use Lampshade. It's so much easier! You can do this all
in three lines of code: two to set up your choices for the form element,
and one to draw the element itself.
http://www.thinkcomputer.com/software/lampshade
I'd be glad to help you with it if you have any questions.
Best of luck,
Aaron
Aaron Greenspan
President & CEO
Think Computer Corporation
http://www.thinkcomputer.com
[Back to original message]
|