I have a requirement for selecting a item from a pulldown list which can then be used to filter the options in a second list. I have spent some time on the message boards and have a solution that should work, but does not! When run it produces a Error page on the Browser "Internal Server Error". (Apache)Checking the error log shows the message"Premature End of Script header"(PHP3.
What am I doing Wrong?? I think it is my use of the form.submit() function, here's the code;
Thanks in advance
Paul
<form name=searchTT action=<?php echo $PHP_SELF;?> method=post>
<?php
$db = mysql_connect("localhost", "root")
or die("Couldn't make connection.");
mysql_select_db("test",$db)
or die("Couldn't select database.");
$query= mysql_query("select distinct satellite as satellite_id from satellite ");
echo"<select name=satellite onchange=\"document.searchTT.submit();\">
\n";
if (!isset($satellite)) {echo "<option value=null selected>Choose a Satellite</option>\n";}
while(list($satellite_id)=mysql_fetch_row($query))
{
echo "<option value=$satellite_id";
if($satellite_id==$satellite){echo "selected";}
echo ">$satellite_id</option>\n";
}
echo "</select>\n";
echo "<select name=Txp_up onchange=\"document.searchTT.submit();\">
\n";
if (!isset($satellite)) {echo "<option value=null selected>Choose a Satellite First</option>\n";}
else
{
$result=mysql_query("select transponder as Txp_id from satellite where satellite='$satellite'");
echo "<option value=null selected>Choose a Txpnr</option>\n";
while (list($Txp_id)=mysql_fetch_rows($result))
{
echo "<option value=$Txp_id";
if($Txp_id == Txp_up) {echo "selected";}
echo ">$Txp_id</option>\n";
}
}
echo "</select>";
?>