PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 7th, 2005, 11:29 AM
PHPNewb PHPNewb is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 PHPNewb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 4 sec
Reputation Power: 0
Radio Buttons

I'm building a band website, the bands have can have up to 8 members and can enter up to 5 influences when they register,
what I want to do is have a page with radio buttons on asking how many band members they have and how many influences.

I want to pass over the radio button output as integers on the next page through session variables, there will be 2 loops going until the number the user entered in the loops corresponding radio button is reached, these loops will simply generate the form inputs for each band member and influence. The script so far is:

PHP Code:
<td width="60%" valign="top"><p>Hello <? echo $_SESSION['valid_user']; ?>, welcome to the backstage area! <a href="logout.php">LOG OUT</a></p> 
<p></p> 
<p></p> 
<p></p>
<p></p> 
<p></p> 
<table width="100%" border="0">
        <tr> 
         <td width="31%"><p>How Many Band Members are there in your Band?</p>
            <p>&nbsp;</p></td>
         <td width="69%" valign="top">2 
 
<form method="post" action="submit.php"> 
 
<input type="radio" name="memberradio" value="radiobutton">
            3 
            <input type="radio" name="memberradio" value="radiobutton">
            4 
            <input type="radio" name="memberradio" value="radiobutton">
            5 
            <input type="radio" name="memberradio" value="radiobutton">
            6 <input type="radio" name="memberradio" value="radiobutton">
            7 <input type="radio" name="memberradio" value="radiobutton">
            8 <input type="radio" name="memberradio" value="radiobutton"> </td>
        </tr>
        <tr> 
         <td><p>How many bands have been a big influence on you?</p>
            <p>&nbsp;</p></td>
         <td valign="top">1 <input type="radio" name="influenceradio" value="radiobutton">
            2 <input type="radio" name="influenceradio" value="radiobutton">
            3 <input type="radio" name="influenceradio" value="radiobutton">
            4 <input type="radio" name="influenceradio" value="radiobutton">
            5 <input type="radio" name="influenceradio" value="radiobutton"></td>
        </tr>
 
</table>
     <input type="submit" name="Submit" value="Submit Details">
     </p></td> 
</tr> 
 
</td> 
</tr> 
</form>
</table> 
 
<?php
if(!empty($_POST)) 
{
$_SESSION['no_of_influences'] = $_POST['influenceradio'];
$_SESSION['no_of_members'] = $_POST['memberradio'];

}
?> 


I just want to know if my session variables are set right and if the radio buttons are automaticly integers or you have to set them as such.

Reply With Quote
  #2  
Old March 7th, 2005, 02:12 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
It would likely be more beneficial to have the value field of your radio buttons be related to the number...
eg 1: 8 <input type="radio" name="memberradio" value="8">
eg 2: 5 <input type="radio" name="influenceradio" value="5">

Reply With Quote
  #3  
Old March 7th, 2005, 05:02 PM
PHPNewb PHPNewb is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 PHPNewb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 4 sec
Reputation Power: 0
OK thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Radio Buttons


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT