hi rulian.
this is dipen mistry from bombay(IND)
i hope i can help you out.
i'll go point wise
- you wont to create 10 radio buttons
lets say you put up a question like
which test you want to give now
- php
- asp
- jsp
- html
- ...
..
..
..upto
10.
for this create and
array of test names (here) &
array of the corresponding test urls
. eg
$arrayTests = array();
$arrayTests[1] = "php";
$arrayTests[2] = "asp";
$arrayTests[3] = "jsp";
$arrayTests[4] = "html;
....
... upto
$arrayTests[10]= "FreeBSD";
$arrayTestsURL[1] = "http://www.php.com";
$arrayTestsURL[2] = "http://www.asp.com";
$arrayTestsURL[3] = "http://www.jsp.com";
$arrayTestsURL[4] = "http://www.html.com;
....
... upto
$arrayTestsURL[10]= "http://www.FreeBSD";
2.
now traverse through this array using a for loop and at the same time write the html tags. for radio button. and you will have to write an event handler as what is to done when the radio button is clicked this part is handled by javascript
like this
<?php
for ( $intCounter = 1 ; $intCounter <= 10 ; $intCounter++ )
{
?><input type="radio" name="test" value="<?php echo $intCounter; ?>"
onClick="javascript:window.location.href('?<? echo $arrayTestURL; ?>')"
<?php echo $arrayTests[$intCounter]; ?> Test
<br><?php
}
this for loop will create a scene similar to this one
o php
o asp
o jsp
o html
o ...
o .
..
..upto
o FreeBse
now when you click the browse will refresh and take u to the url specified in the javascript section.
if ya still have problem tell me
i'll mail you the running script
cya buddy
dips
dipenmistry@rediffmail.com