Hi I am extremely new at PHP. But like a nimrod I decided to use it in my senior project.
Here is the code from the search box:
<td width="99%" rowspan="2" align="center"><form action="results.php" method="post" name="area" id="area">
<input name="area" type="text" id="area">
<input type="submit" name="Submit" value="Submit">
</form> </td>
ok now here is the code from my results page:
<?php require_once('Connections/Aiph.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
$sql = mysql_query("SELECT CityArea, FROM 'restaurant' WHERE CityArea LIKE %$area% ") or die (mysql_error());
?>
}
$maxRows_Recordset5 = 5;
$pageNum_Recordset5 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset5'])) {
$pageNum_Recordset5 = $HTTP_GET_VARS['pageNum_Recordset5'];
}
$startRow_Recordset5 = $pageNum_Recordset5 * $maxRows_Recordset5;
mysql_select_db($database_Aiph, $Aiph);
$query_Recordset5 = "$sql";
$query_limit_Recordset5 = sprintf("%s LIMIT %d, %d", $query_Recordset5, $startRow_Recordset5, $maxRows_Recordset5);
$Recordset5 = mysql_query($query_limit_Recordset5, $Aiph) or die(mysql_error());
$row_Recordset5 = mysql_fetch_assoc($Recordset5);
if (isset($HTTP_GET_VARS['totalRows_Recordset5'])) {
$totalRows_Recordset5 = $HTTP_GET_VARS['totalRows_Recordset5'];
} else {
$all_Recordset5 = mysql_query($query_Recordset5);
$totalRows_Recordset5 = mysql_num_rows($all_Recordset5);
}
$totalPages_Recordset5 = ceil($totalRows_Recordset5/$maxRows_Recordset5)-1;
$queryString_Recordset5 = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset5") == false &&
stristr($param, "totalRows_Recordset5") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset5 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset5 = sprintf("&totalRows_Recordset5=%d%s", $totalRows_Recordset5, $queryString_Recordset5);
?>
The Connections/Aiph.php connects to my database for the recordset.
Ok I am sure you are asking what is with all the recordset crap? Well I want to display the reults in an orderfashion. If you check out this link:
stu.aii.edu/~anl183/php/index.php
You will be able to check out what I am trying to do. The individual links work i.e. Houston, Raleigh, etc.
I would appreciate any help to figure out what I have done wrong.
Thanks
Nicole