Right, I had some excellent help from some of you guys before - so I thought I`d ask again...
I have some code which passes the selection of a dynamically created dropdown list onto a redirection page, thus:
</p>
</div>
<form name="formname" method="get" action="redirect.php">
<div align="center">
<select name="redirect" >
<?php
$cursor = mysql_query("select distinct County, HRef from Main order by County asc");
if (!$cursor)
{
echo("<H3>MySQL error: " . mysql_error() . "</H3>");
exit();
}
while ( $row = mysql_fetch_array($cursor) )
{
if ($row["County"] <> "Advertisement")
{
print ("<option value=\"" . $row["HRef"] . "\">" . $row["County"] . "</option> ");
}
}
?>
</select>
<input type="submit" value="Go!">
</div>
</form>
With the coding on the redirection page like this:
<?php
header ("Location: " . $_GET['redirect']);
?>
My question is twofold. Firstly, I cant see where the HRef is actually passed to $_GET - why is it that and not County? because its a value?
Secondly, on other pages I want to change this code to perfom a different function. I want another dynamically generated dropdown box, (this time of districts), and the resulting selection must be passed onto a MySQL query so that only those districts are pulled from the database. I`m sure the answer to the first question will help me with this. If possible I want this to be done on the same page.
Any help will be very gratefully received. Thanks!🙂