Hello,
I have a script that returns results on the same page based on input fields in a simple form, using method=POST. I also want to use this same script for the same variables passed from another page, using GET, depending on how the user finds the page. Is there a way to do this without the POST taking priority and eliminating the GET values?
Here's the code:
$query = "SELECT * from grants where cycle = '$cycle' && size = '$size' || school = '$school' ";
$result = mysql_query($query,$dbconnect);
?>
Select Grant Type:<br>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<select name="school" size="1">
<option value="%" selected>All Grants</option>
<option value="District Wide">District Wide</option>
<option value="All Elementary">All Elementary Schools</option>
<option value="Broadmeadow">Broadmeadow</option>
</select>
Select Grant Cycle:<br>
<select name="cycle" size="1">
<option value="%" selected>All Grant Cycles</option>
<option value="Fall 2008">Fall 2008</option>
<option value="Spring 2008">Spring 2008</option>
</select>
<input type="submit" name="submit" value="search"></form>
And from the other page:
<a href="table-of-grants-cycle.php?school=Hillside">
So if the form is submitted, the search returns appropriate results. But if the data is passed from the other page, the GET data is blank.
I'm probably not explaining this well, but if you get what I'm after and have any suggestions, I'd appreciate the help.
Thanks!