Page 1 of 1

Keep the results of a radio button, checkbox and list

Posted: Sun Mar 28, 2004 6:08 pm
by John Cartwright
How do I keep the results of a radio button, checkbox and list.

For a checkbox what do I do..

Code: Select all

<INPUT type=checkbox value=<? echo "$_SESSION['contact_icq']"; ?> name="contact_icq">
When I do that nothing happens when the form is reloaded on submit.

Posted: Sun Mar 28, 2004 8:15 pm
by danyprundus
Try
<INPUT type=checkbox value=<? echo "$_SESSION['contact_icq']"; ?> name="contact_icq">

Code: Select all

<?php
<INPUT type=checkbox value=<? echo "$_SESSION['contact_icq']"; ?> name="contact_icq"
<?
if($_SESSION['contact_icq']) echo ' checked ' 
?>
> 

?>

Posted: Sun Mar 28, 2004 8:33 pm
by d3ad1ysp0rk
make sure the session is set BEFORE being called

Posted: Sun Mar 28, 2004 8:34 pm
by John Cartwright
I figured it out on my own but tahnks alot for the help :p

cheers