Article:
  Working with Forms in PHP, Part 1
Subject:   better solution to test for form vars
Date:   2003-03-14 02:47:01
From:   mattrohrer
would involve using isset() or empty():


<?php
/* Assume a checkbox by the name 'mycheckbox' exists */
$checkbox = !empty($_GET['mycheckbox']);
?>


as the method shown in the article could trigger an E_NOTICE error

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • better solution to test for form vars
    2004-01-24 19:09:26  ckt [View]

    Hi,
    I want to an array of checkbox.
    Is it possible to do the same thing as
    indicated in this article for the
    "input text" fields ?
    Will there be any problem in checking
    the checkboxes in an array ?
    thx