Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
radio button name coming from a query...
Old 02-12-2009, 07:36 AM radio button name coming from a query...
Junior Talker

Posts: 4
Name: stubby
Trades: 0
hi to every one.. i'm just wondering if a radio button's name will be coming from a query result.. please see my code below..


<?php while($r_cat = mysql_fetch_assoc($result)) { ?>
<tr>
<?php $ctr = count($dept_id);?>
<td>&nbsp;</td>
<td><?php echo $r_cat['cat_name']; ?></td>
<td><input type="radio" name="<?php echo $r_cat['cat_name'];?>" id="radio" value="3" /></td>
<td><input type="radio" name="<?php echo $r_cat['cat_name'];?>" id="radio2" value="1" /></td>
<td><input type="radio" name="<?php echo $r_cat['cat_name'];?>" id="radio3" value="-3" /></td>
<td>&nbsp;</td>
</tr>
<?php }//end while ($r_cat = mysql_fetch_assoc($result)) ?>

notice the name of the radio button came from a result.. is it possible to get the post value of this radio button.. like $_POST['name of the radio button']..?
stubbykiller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-12-2009, 07:56 AM Re: radio button name coming from a query...
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
yes, just use:
PHP Code:
$_POST['name of the radio button']; 
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 02-12-2009, 08:06 AM Re: radio button name coming from a query...
Junior Talker

Posts: 4
Name: stubby
Trades: 0
rogem002, seems like you did not understand me.. see this code...
name="<?php echo $r_cat['cat_name'];?>" is it possible to post this as
$_POST['<?php echo $r_cat['cat_name'];?>].. i know its not.. my question is how will i post the name of this radio button
stubbykiller is offline
Reply With Quote
View Public Profile
 
Old 02-12-2009, 11:40 AM Re: radio button name coming from a query...
lizciz's Avatar
Webmaster Talker

Posts: 744
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I *think* you mean like this.
PHP Code:
$_POST[$r_cat['cat_name']]  // This is valid 
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to radio button name coming from a query...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13464 seconds with 12 queries