hey folks, have an annoying problem. I have a form which spreads over 2 pages. i want to pass all the values from the fisrt page of the form to the second. it was easy to pass the 'text area' values using a simple echo "$value" PHP: code. However i need to pass the value of a checked radio button so that the same button is checked on the next page. Does any1 know how to do this?? i am kind of a novice with PHP so i apologise if it is really obvious!! thanks in advance clouting ..........
pass the value ($value) to the second page as normal.. if ($value == $whatever) { echo "this is my html"; } else if ($value == $whatever2) { echo "this is my html"; } else { echo "this is some other html"; } Or you can use a switch www.php.net/switch
You are using post to submit the values to another page? You should be able to access the values with $_POST['radio']; Assuming... <input type="radio" name="radio" value="1">Yes <input type="radio" name="radio" value="0">No That should be it really. You can also try using $_REQUEST, but it is less secure than $_POST.
He is trying to take the post data and pre select a radio button on a second form page - based on the post data
is this what you want?? let say you have $_REQUEST['myradio'] from the first page. <form> <input type="radio" name="fruit" value="apples" style="border-width: 0px;" <?php if($_REQUEST['myradio']) echo "checked=\"checked\""; ?>> Apples </form>
right. iam using the code posted by fairuz.ismail sorry for an obviousquestion but where exactly do i put the $_REQUEST['myradio'] on the form?? i know its on the first page buti just need to know howi add the code. thanks in advance