Mailinglisten-Archive |
Am Friday 06 October 2006 15:12 schrieb Yannik Hampe:
> Thomas Winter wrote:
> > Hi,
> > print "<input type='checkbox' name='cbutton[1]' value='yes' />";
> > print "<input type='checkbox' name='cbutton[2]' value='yes' />";
> >
> > Wäre das hier eine korrekte Abfrage ob eine bestimmte Checkbox markiert
> > wurde:
> >
> > if ( isset($_REQUEST['cbutton']) and
> > array_key_exists('1', $_REQUEST['cbutton']) and
> > $_REQUEST['cbutton'][1] == 'yes') {
> > print "<br>Button 1 gedrückt" . $_REQUEST['cbutton'][1];
> > }
> >
> > Oder geht es einfacher?
>
> Ja:
> if (!empty($_REQUEST['cbutton'][X])) //checked
> value kannst du dir dann eigentlich sparen.
danke,
Stimmt, EMPTY liefert auch bei nicht vorhandener Variable ein FALSE.
Hoffentlich bleibt das so!
Gruß
Thomas
php::bar PHP Wiki - Listenarchive