PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Tue May 08, 2007 2:58 pm
The code from my selection form is
Code: Select all
if (mysql_num_rows($result1) > 0) {
echo "<form action='embryoedit.php' method=post>";
echo "<select name='sirelist' size='10'>";
while ($row = mysql_fetch_array($result1)) {
extract($row);
echo "<option value=\"".htmlspecialchars($amimalid)."\">$animalid";
}
echo "</select>";
echo "<input type=submit value=submit>";
echo "</form>";
}
else
{
$nothingfound="No Inventory Listed";
echo "<h1 align='center'>$nothingfound</h1>";
}
The form fills correctly with values and after I select the value I want and go to embryoedit.php
The code from embryoedit.php is
Code: Select all
$sire_to_use = $_POST['sirelist'];
Var_Dump() shows $sire_to_use to be an empty strings.
Thank you
Last edited by
PastorHank on Tue May 08, 2007 4:59 pm, edited 1 time in total.
guitarlvr
Forum Contributor
Posts: 245 Joined: Wed Mar 21, 2007 10:35 pm
Post
by guitarlvr » Tue May 08, 2007 3:06 pm
Not sure if this will fix it but you might try putting double quotes " around post.
Code: Select all
echo '<form action="embryoedit.php" method="post">';
Wayne
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Tue May 08, 2007 3:12 pm
No, that didn't change things.
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Tue May 08, 2007 4:57 pm
<pre>
Returned this
Array
(
[sirelist] =>
)
I'm not sure how much of the HTML you want, the only thing that exists
is
Code: Select all
<html>
<head> <title> Bloodlines of the Legends - Embryo Inventory Maintenance </title> </head>
<body bgcolor="#DEB887">
and then the php starts
I create a table for my top graphics
Code: Select all
echo "<table align='center' border='2' width='400' bgcolor='#800000' bordercolor='#000000'>";
echo "<tr>\n
<td>
<img border='0' src='../images/logo.gif' width='400' height='72' style='border: 0px ridge #800000;
padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px'>
</td>
</tr>";
echo "</table>\n";
$animaltype="List Of Available Embryos - By Sire";
echo "<h1 align='center'>$animaltype</h1>";
if (mysql_num_rows($result1) > 0) {
echo '<form action="embryoedit.php" method="post">';
echo '<select name="sirelist" size="10">';
while ($row = mysql_fetch_array($result1)) {
extract($row);
echo "<option value=$amimalid>$animalid";
}
echo "</select>";
echo "<input type=submit value=submit>";
echo "</form>";
}
else
{
$nothingfound="No Inventory Listed";
echo "<h1 align='center'>$nothingfound</h1>";
}
?>
</body></html>
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Tue May 08, 2007 4:58 pm
I found it. I had mispelled animal.....
thanks for the suggestions