I have two radio button categories: color1 and color2. Color 1 can be either black or white and color 2 can be either red or blue. I just want the user to be able to pick from just one category or both categories and then echo out the choices with PHP.
My problem is that it will not echo out choices from both categories at the same time. For example, if I click the "white" radio button and then click the "blue" radio button, it will only echo out "blue", not both "white" and "blue".
UPDATE:
<?php
session_start();
if(isset($_GET['color1'])){
$_SESSION['color1'] = $_GET['color1'];
}
if(isset($_GET['color2'])){
$_SESSION['color2'] = $_GET['color2'];
}
echo $_SESSION['color1'];
echo $_SESSION['color2'];
?>
select first color:<br/>
<input type="radio" name="color1" value="black" onchange="window.location.href='recom.php?color1='+this.value"> black<br />
<input type="radio" name="color1" value="white" onchange="window.location.href='recom.php?color1='+this.value"> white<br />
select second color:<br/>
<input type="radio" name="color2" value="red" onchange="window.location.href='recom.php?color2='+this.value"> red<br />
<input type="radio" name="color2" value="blue" onchange="window.location.href='recom.php?color2='+this.value"> blue