value is always woods, even if i select house...
Posted: Fri Apr 16, 2004 6:27 pm
Code: Select all
<?php
foreach ($HTTP_POST_VARS as $key => $value)
{
$region =$key;
$danger =$value;
}
include ("animalhunt.php");
$sql1 = "SELECT regionID FROM regions WHERE region = '$region'";
$r = mysql_query($sql1) or die(mysql_error()) ;
while ($row = mysql_fetch_array($r))
{
extract($row);
$region_ID = $regionID;
}
$sql2 = "SELECT name, pic FROM $danger WHERE regID LIKE '$region_ID' ORDER BY name ASC";
$r2 = mysql_query($sql2) or die(mysql_error()) ;
$rowCheck = mysql_num_rows($r2);
if($rowCheck > 0){
/* Display results in a table */
echo "<h1>$danger types</h1>";
echo "Identify the source if possible and click the button next to it, taking care to avoid another person being affected. Identification is not necessary, but may be helpful. <br>";
echo "<table cellspacing='15'>";
echo "<tr><td colspan='8'><hr></td></tr>";
echo "<tr>\n
<td>If you didn't see, it's ok, just select the kind of area you were in at the time or suspected time of infection.</td>\n
<td>";
$habitatcheck = "SELECT DISTINCT habitat FROM habitat ORDER BY habitat";
$habitatcheckresult = mysql_query($habitatcheck)or die ("Couldn't execute query.");
/* create form containing selection list */
echo "<form action='processhabitat.php' method='post'>
<select name='habitat'>\n";
while ($row = mysql_fetch_array($habitatcheckresult))
{
extract($row);
echo "<option value='$habitat'>$habitat\n";
}
echo "</select>\n";
echo "<input type='hidden' name='$danger' value='$habitat'>
<input type='submit' value='Select Habitat'>
</form>\n";
echo "<tr><td colspan='3'><hr></td></tr>\n";
while ($row = mysql_fetch_array($r2))
{
extract($row);
echo "<tr>\n
<td>$name</td>\n
<td>";?> <img src="<?php echo "$pic";?>" alt="<?php echo "$name";?>" hspace="10" vspace="10" align="left" border="0" /><?php echo "</td>
<td><form action='processlookedlike.php' method='post'>
<input type='hidden' name='$danger' value='$name'>
<input type='submit' value='continue'>
</form>\n
</tr>\n";
echo "<tr><td colspan='3'><hr></td></tr>\n";
}
echo "</table>\n";
}
else{
echo "<h1>No sources available</h1>";
echo "We are sorry, either no information has been entered into the database or there are no sources in your area<p>
However, it is not infeasable that a source not native to this area has made it's way in one way or another, and we would strongly reccomend that if you have any doubts or worries, see a doctor or go to the local hospital. <br>";
}
?>