Posted by Paul on 05/26/05 22:00
comp.lang.php wrote:
> I have a page with multiple submit buttons. Call them "ok" and
> "cancel". I have the coding in PHP as:
>
> if (isset($ok)) { something } and if (isset($cancel)) { something
> else }
>
> This works fine in PHP 4.X. In PHP5 it doesn't work at all (no action
> at all). What is the replacement coding and how can I code so that it
> works in all versions of PHP?
>
> Shelly
>
Your problem is not PHP 5. I think in PHP 5 they finally decided to
tighted up the security a bit and disabled automatic registration of
post and get variables... your solution would be something like this...
$ok = !empty($_POST['ok']) ? $_POST['ok'] : null;
$cancel = !empty($_POST['cancel']) ? $_POST['cancel'] : null;
if (isset($ok)) { something; }
else ................
hope that helps..
[Back to original message]
|