
09-10-10, 12:28 PM
|
|
Newbie Coder
|
|
Join Date: Sep 2010
Location: Greenock
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Golith
i would be doing this inside the html first
|
Where exactly do i put that piece of code in the html page :
Quote:
<?PHP
// make sure that all values are set to unchecked in case the page has been refreshed
$Search engine_status = 'unchecked';
$Advertising = 'unchecked';
$referral_status = 'unchecked';
$Facebook = 'unchecked';
$Other = 'unchecked';
if (isset($_POST['Submit1'])) {
$selected_radio = $_POST['list'];
if ($selected_radio == 'Search engine') {
$searchengine= 'checked';
}else if ($selected_radio == 'Advertising') {
$adveretising= 'checked';
}else if ($selected_radio == 'referral') {
$adveretising= 'checked';
}else if ($selected_radio == 'Facebook') {
$adveretising= 'checked';
}else if ($selected_radio == 'Other') {
$adveretising= 'checked';
}
}
?>
// To get the value of a radio button with PHP code, again you access the NAME attribute of the HTML form elements
so add name='submit1' to the <form>
|
|