www.webdeveloper.com
Results 1 to 2 of 2

Thread: Passing Checkbox/Form Info to Php

  1. #1
    Join Date
    Jul 2008
    Posts
    38

    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.

    Code:
    <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>
    <br>
    </div>
    </form>
    <button type="button">Click Here</button>

  2. #2
    Join Date
    Aug 2007
    Location
    Washington
    Posts
    219
    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



Recent Articles