
March 7th, 2005, 11:29 AM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 2
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> </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> </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.
|