bp_travis
10-01-2007, 04:07 PM
Hello. I have what seems like a simple need, but it seems to be getting complex. I have a site that displays results of certain critiria and I want a form at the top of the page that is able to filter the results. Problem is, that the first criteria that is given to the PHP is a $GET from the address bar, while the form at the top is a $POST. When I try to do it, it displays the info from the $POST and the $GET. Here is a simplified version of the PHP. Thanks
if(isset($_POST)){
$show=$_POST['show'];
if ($show=='gke'){
echo $show;
}
}
if (isset($_GET)){
$show=$_GET['show'];
echo $show;
}
<form action="" method="post" name="show">
Filter By:<br />
Show:
<select name="show" id="show" onchange=document.show.submit();>
<option selected value="ge">Groom Expo</option>
<option value="gke">GKE</option>
</select>
Breed:
<select name="select">
<option value="Poodle" selected="selected">Poodle</option>
<option value="Terrier">Terrier</option>
<option value="Spaniel">Spaniel</option>
</select>
</form>
if(isset($_POST)){
$show=$_POST['show'];
if ($show=='gke'){
echo $show;
}
}
if (isset($_GET)){
$show=$_GET['show'];
echo $show;
}
<form action="" method="post" name="show">
Filter By:<br />
Show:
<select name="show" id="show" onchange=document.show.submit();>
<option selected value="ge">Groom Expo</option>
<option value="gke">GKE</option>
</select>
Breed:
<select name="select">
<option value="Poodle" selected="selected">Poodle</option>
<option value="Terrier">Terrier</option>
<option value="Spaniel">Spaniel</option>
</select>
</form>