Form Dengan Single Checkbox 21.05.08

  • PHP
  • Comments Off on Form Dengan Single Checkbox
  • 0
  • Borang ringkas dengan satu checkbox.

    [code lang=”php”]
    <html>
    <body>
    <?php
    if(isset($_POST[‘hantar’]))
    {
    if(isset($_POST[‘bantuan’]) == ‘Ya’)
    echo "Perlukan bantuan.";
    else
    echo "Tidak perlukan bantuan.";
    }
    else
    {
    ?>

    <form action="<?php echo $_SERVER[‘PHP_SELF’]; ?>" method="post">
    Anda perlukan bantuan?
    <input type="checkbox" name="bantuan" value="Ya" />
    <input type="submit" name="hantar" value="Hantar" />
    </form>

    <?php
    }
    ?>

    </body>
    </html>
    [/code]

    Demo

    Related Articles

    Comments are closed.