I am putting php code inside a frontpage html template. The php code is not being recognized at all. I haven't worked with this template before and I noticed "Applet DPAText started" in the lower left of the page when I execute it. I don't know applets but I assume it is something that was written in the template.
Anyway, could that be why the program is not executing the php code?? Or, do you see a reason why the php isn't working??
This is what I have written:
<form method="get" action="?PHP_SELF?">
<font face="Arial" color="#0000FF" size="3">Search by Zip Code:
<input type="text" name="search" size="5">
<input type="submit" value="Go" name="zipsrch"><br><br><br></form>
<script language="php">
echo "within php before anything else";
if($zipsrch == "Go") {
echo "before connect to database!!!";
include "conndb.php";
$srch = "SELECT * FROM `coupons` WHERE 1 AND `coupons_zip` LIKE '%$search%'";
$query = mysql_query($srch) or die ("Could not execute search: $query. " . mysql_error());
echo '<font size="2">';
$num=mysql_num_rows($query);
echo "connected to database!!!";
if($num>0) {
while($row = mysql_fetch_array($query)) {
echo "<table border=\"0\" cellspacing=\"2\" style=\"border-collapse: collapse\" width=\"100%\" id=\"AutoNumber2\">";
echo "<tr>";
echo "<td width=\"41%\"><font size=\"2\">".stripslashes($row["coupons_business_name"])."</font></td>";
echo "<td width=\"59%\"><font size=\"2\"><a href=\"".stripslashes($row["coupons_path"])."\">Get Coupon</a></font></td>";
echo "</tr>";
echo "<tr>";
<td width="41%">New York Style Bagel Shop</td>
<td width="59%">Get Coupon</td>
</tr>
</table>
}
} else {
echo 'No zip code matched your search.';
echo '<br><br>There are currently no coupons for zip code ' + 'search' + '.';
}
}
[code=php]
</script>