Results 1 to 2 of 2

Thread: Passing Checkbox/Form Info to Php

  1. #1
    Join Date
    Jul 2008

    Passing Checkbox/Form Info to Php

    I'm trying to create a bunch of checkboxes that pass information to a php script in code.

    When "Page1" is checked, I need a php variable $page1 to be set equal to false. The same for Page2 and Page3. When the button is clicked, a php variable $run becomes set equal to true.

    <form name="myform" action="" method="POST">
    <div align="center"><br>
    <input type="checkbox" name="option1" value="Page1"> Page1<br>
    <input type="checkbox" name="option2" value="Page2" checked> Page2<br>
    <input type="checkbox" name="option3" value="Page3"> Page3<br>
    <button type="button">Click Here</button>

  2. #2
    Join Date
    Aug 2007
    Basically what you do is set the action of the form to a PHP page, and from there you can access the POST variables and work with them as needed.

    Here's a good read that will probably help you out a quite a bit: http://www.tizag.com/phpT/examples/formex.php

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center