Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2013, 11:32 AM   PM User | #1
Spudster
New Coder

 
Join Date: Jul 2012
Posts: 54
Thanks: 5
Thanked 0 Times in 0 Posts
Spudster is an unknown quantity at this point
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
Spudster is offline   Reply With Quote
Old 01-11-2013, 11:38 AM   PM User | #2
hinch
Regular Coder

 
hinch's Avatar
 
Join Date: Sep 2005
Location: UK
Posts: 921
Thanks: 25
Thanked 79 Times in 79 Posts
hinch is on a distinguished road
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
hinch is offline   Reply With Quote
Users who have thanked hinch for this post:
Spudster (01-11-2013)
Old 01-11-2013, 12:14 PM   PM User | #3
Spudster
New Coder

 
Join Date: Jul 2012
Posts: 54
Thanks: 5
Thanked 0 Times in 0 Posts
Spudster is an unknown quantity at this point
I assume the valueindb is a mysql_fetch_array, I try this and reply here asap.
Spudster is offline   Reply With Quote
Old 01-11-2013, 12:23 PM   PM User | #4
Spudster
New Coder

 
Join Date: Jul 2012
Posts: 54
Thanks: 5
Thanked 0 Times in 0 Posts
Spudster is an unknown quantity at this point
Thought it would be fairly simple what you specified has given me a similar idea. Thanks for the help :-)
Spudster is offline   Reply With Quote
Old 01-11-2013, 01:23 PM   PM User | #5
hinch
Regular Coder

 
hinch's Avatar
 
Join Date: Sep 2005
Location: UK
Posts: 921
Thanks: 25
Thanked 79 Times in 79 Posts
hinch is on a distinguished road
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
hinch is offline   Reply With Quote
Old 01-12-2013, 11:08 AM   PM User | #6
Spudster
New Coder

 
Join Date: Jul 2012
Posts: 54
Thanks: 5
Thanked 0 Times in 0 Posts
Spudster is an unknown quantity at this point
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 12:31 PM..
Spudster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:45 AM.


Advertisement
Log in to turn off these ads.