Jump to content

[SOLVED] POST not working.


EagleAmerican

Recommended Posts

I'm pretty sure the code has nothing to do with it because it works on the other host but not on the new one.. but here it is:

 

search.php

 

<form method="post" action="execute_search.php">
<table width=90% align=center>
<tr><td>Search for Parasite:</td><td><input type="text" name="search" size="60" maxlength="255"></td></tr>
<td></td><td><input type="submit"></td></tr>
</table>
</form>

 

execute_search.php (I get the message "Please go back and enter something to search for." no matter what. Even if I enter a search.

 

<?php

if ($search) // perform search only if a string was entered.
{

$dbcnx = @mysql_connect('', '', '');
if (!$dbcnx) {
   exit('<p>Unable to connect to the ' .
       'database server at this time.</p>');
}

$srch="%".$search."%";
$query = "select * from parasite WHERE parasitename LIKE '$srch'";

$result = mysql_db_query("adaarm_db", $query);

if ($result)
{
echo "Search Results:<br><br>";
echo "<table width=90% align=center border=1><tr>
<td align=center>Name</td>
<td align=center>From</td>
<td align=center>Genre</td>
</tr>";

while ($r = mysql_fetch_array($result)) { // Begin while
$id = $r["id"];
$name = $r["parasitename"];
$from = $r["parasitefrom"];
$genre = $r["parasitegenre"];
echo "<tr>
<td><a href=view.php?id=$id>$name</a></td>
<td>$from</td>
<td>$genre</td></tr>";
} // end while
echo "</table>";
} else { echo "Error 8574"; }
} else {
echo "Please go back and enter something to search for.";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.