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 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Getting Radio Data

    Hey,

    I am making a feature using html circle radio buttons Now when the option is yes in the database i want it to display like this http://tinypic.com/view.php?pic=mw4nll&s=6 even when the user refreshes the page or comes back later the dot will still be on the On option or if its off or no in the database the dot will be on off (vice versa)

    Im using php to proccess the option to the database.

    (making a forum software)
    This is harder to explain hope the image helps :-)

    Thanks

  • #2
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    Code:
    <?php
    if ($valueindb="yes") {
      $selected = "selected=\"selected\"";
    } else {
     $selected = "";
    }
    ?>
    <input type="radio" name="whatever" id="whatever" value="yes" <?php echo $selected;?> />
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  • Users who have thanked hinch for this post:

    Spudster (01-11-2013)

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I assume the valueindb is a mysql_fetch_array, I try this and reply here asap.

  • #4
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thought it would be fairly simple what you specified has given me a similar idea. Thanks for the help :-)

  • #5
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    Quote Originally Posted by Spudster View Post
    Thought it would be fairly simple what you specified has given me a similar idea. Thanks for the help :-)
    good good

    Quote Originally Posted by Spudster View Post
    I assume the valueindb is a mysql_fetch_array, I try this and reply here asap.
    yes $valueindb is the value of the column / row in your db that stores either your yes or no
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  • #6
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok ive got that to work, Would you know how to add forum gatagories so forums can loop though those on the index like mybb,phpbb,vbulletin etc..
    I,m also trying to create a permission system so ever forum has a unique permission so the admin group can look into a certain forum while a certain user or group gets denied by seing a forum etc..
    I am coding a forum system.

    Starts to get abit harder now.

    Some people dont get this far :.)
    Last edited by Spudster; 01-12-2013 at 01:31 PM.


  •  

    Posting Permissions

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