Hello,
I need some help on how i can implement a list/menu dropdown navigation on my output page. Ex. the data of the list/menu are numbers 1,2,3.. and so on. When they choose to a specific number they will be directed to that certain record set.
Below is the code for my searchresults.php I made this page using dreamweaver mx.
<?php require_once('Connections/CCCI.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$R1_Recordset1 = "1";
if (isset($HTTP_GET_VARS['R1'])) {
$R1_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['R1'] : addslashes($HTTP_GET_VARS['R1']);
}
$colname_Recordset1 = "1";
if (isset($HTTP_GET_VARS['category'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['category'] : addslashes($HTTP_GET_VARS['category']);
}
$maxRows_Recordset1 = 10;;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "1";
if (isset($HTTP_GET_VARS['searchfield'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['searchfield'] : addslashes($HTTP_GET_VARS['searchfield']);
}
mysql_select_db($database_CCCI, $CCCI);
$query_Recordset1 = sprintf("SELECT * FROM COMPANY WHERE COMPANY_NAME LIKE '%%%s%%' OR COMPANY_CATEGORY LIKE '%%%s%%' OR COMPANY_LINE_OF_BUSINESS LIKE '%%%s%%' ORDER BY COMPANY_NAME ASC", $colname_Recordset1,$colname_Recordset1,$colname_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $CCCI) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body bgcolor="#FFFFCC">
<table width="100%" border="1">
<tr bgcolor="#669999">
<td bgcolor="#669999"><div align="center"><font color="#FFFFFF"><strong>COMPANY
NAME</strong></font></div></td>
<td> <div align="center"><font color="#FFFFFF"><strong>BUSINESS</strong></font></div></td>
</tr>
<?php do { ?>
<tr>
<td width="37%"><font color="#000000" size="2"><a href="detail.php?recordID=<?php echo $row_Recordset1['COMPANY_ID']; ?>" target="_blank"><?php echo $row_Recordset1['COMPANY_NAME']; ?></a></font></td>
<td width="63%"><font color="#000000" size="2"><?php echo $row_Recordset1['COMPANY_LINE_OF_BUSINESS']; ?></font></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<pre>Record(s)<strong> </strong><?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <strong><?php echo $totalRows_Recordset1 ?></strong>
</pre>
<p> </p>
</body>
<?php
mysql_free_result($Recordset1);
?>