You have lots of incorrect HTML code. Use http://validator.w3.org to validate it.
their3as0n;10991197 wrote:
<form action="byDonation.php" method="get">
Donation Amount: <input type="text" name="amt"> <br/>
<input type="submit" value="Submit">
</form>
The form element doesn't allow inline elements, only block elements. No idea if this would cause some browsers to ignore your form contents, but it could happen. There should be neither text nor input elements (directly) in that form after all. Otherwise I don't see a reason for the issue you have, unless you also directly access myDonation.php (without the querystring: ?amt=5000), or if myDonation.php is also used to display the search form.
As for your myDonation.php file, there are some things to fix in that as well
# where's the head and body elements?
# This will deal with the problem of amt not being set
if (empty($_GET['amt']))
{
echo 'Nothing to search for. <a href="/path/to/search_page.php">Back to search page</a>.';
}
else
{
$amt=$_GET['amt'];
echo " <h1> Results of the Search for ".$amt."</h1> ";
# Let's say the user searches for 500. Your search will then use this in a string
# context, with wildcards before and after the string. That is, the search will
# match "1500", "500", "50020", "25003" etc
$result = mysql_query(" SELECT * FROM donors where amount like '%$amt%' ");
# You should most likely rather do this
$amt = (int) $_GET['amt'];
$where = "WHERE amount = $amt";
# Or this
# Include some radio buttons for <, =, > in the search form. I.e.
# <input type="radio" name="operator" value="<" />
# <input type="radio" name="operator" value="=" />
# <input type="radio" name="operator" value=">" />
if (!in_array($_GET['operator'], array('<', '=', '>')))
$_GET['operator'] = '=';
$where = "WHERE amount $_GET[operator] $amt";
# Where's your table, tds, /tds, /trs, /table? Once again: validate your html code
# Why are you using br elements for formatting that should be done using css?
# Why aren't you using a thead element (with tr and th elements) for the table
# column header (where you'd put Donator SSN, Donator Name etc) so that you
# actually use the table as a table.
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "Donator SSN: " . $row['donatorSSN'] . "<br/>";
echo "Donator Name: " . $row['donorName'] . "<br/>";
echo "Address: " . $row['Address'] . "<br/>";
echo "Amount: " . $row['amount'] . "<br/>";
echo "Group Name: " . $row['groupName'] . "<br/><br/> <br/>" ;
}
mysql_close($con);
?>
<!-- where's the /bodyl -->
</html>