Page 1 of 1

New Another Pair of Eyes Please

Posted: Mon Aug 28, 2006 2:13 pm
by PastorHank
In my program this code seems to be working properly

Code: Select all

echo "<form action='pedigree.php' method=post>"; 
echo "<select name='deerlist'>";

 while ($row = mysql_fetch_array($result)) {
  extract($row);
  	 echo "<option value='$deerunumber'>$deernumber\n";
}
echo "</select>";
echo "<input type=submit value=submit>";
echo "</form>";
By properly, I mean the list is populated with the right information. In pedigree.php, I have the following code at the top (where I've always put it..)

Code: Select all

$deer_to_use=strip_tags(trim($_POST['deerlist']));

echo 'deer to use is ->'. $deer_to_use;
$deer_to_use is always empty.

Could someone please tell me what I'm overlooking.

Thank you

Posted: Mon Aug 28, 2006 2:17 pm
by RobertGonzalez
EDIT | Sorry, I didn't read the post properly. Maybe we can try this.

Code: Select all

<form action="pedigree.php" method="post">
<select name="deerlist">
<?php
while ($row = mysql_fetch_array($result)) {
     echo '<option value="' . $row['deerunumber'] . '">' . $row['deernumber'] . '</option>';
}
?>
</select>
<input type="submit" value="submit">
</form>
Then, in your checking page, check isset($_POST['deerlist']) and process from there.

Re: New Another Pair of Eyes Please

Posted: Mon Aug 28, 2006 2:17 pm
by Luke
Change this:

Code: Select all

echo "<option value='$deerunumber'>$deernumber\n";
to this:

Code: Select all

echo "<option value='$deernumber'>$deernumber\n";

Posted: Mon Aug 28, 2006 2:22 pm
by PastorHank
Thank you...it was the spelling of deernumber....I've been reading the code for the past 4 hours looking for that...

This forum has saved me hours of pulling out my hair (and since I'm bald anyway...that's quite a blessing..)

Thanks again

Posted: Mon Aug 28, 2006 2:23 pm
by RobertGonzalez
EDIT | Removed 'cuz it was silly.