Reply to Re: Multiple submits broken in PHP5

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация