Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2010
    Posts
    122
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Php Checked Box Problem

    i have 4 checked boxes in my form .....

    when the editing page how can i get checkbox checked or not cheked


    option 1 Checkbox1
    option 2 Checkbox2
    option 3 Checkbox3
    option 4 Checkbox4

    if the database checkbox1 value=1 value ..

    how can i retreiwed to the edit page Checkbox1 checked.


    plz plzzzzzzzzzz give me sample code for this..........................

  • #2
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    PHP Code:
    <?php
    if($checkbox1) {
     
    $checked1 ' checked="checked" ';
    }
    ?>
    <input type="checkbox" name="checkbox1" <?php echo $checked1?> />

  • #3
    Regular Coder
    Join Date
    Sep 2010
    Posts
    122
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by poyzn View Post
    PHP Code:
    <?php
    if($checkbox1) {
     
    $checked1 ' checked="checked" ';
    }
    ?>
    <input type="checkbox" name="checkbox1" <?php echo $checked1?> />
    Thankz a lot for the help


    Thankzzzzzzzzzzzzzzz
    Last edited by coolumanga; 11-05-2010 at 10:48 AM.


  •  

    Posting Permissions

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