I have a search page that has a couple of drop down menus. I want to be able to select some stuff > hit submit > have the results sent over a URL parameter and then have the results page pick them up. So far I got the search page to work...I can see the URL varibales being passed
(i.e. http://localhost/result3.php?box=Web_02&Submit=Submit)
On the other side when I run a test on my SQL Query for the results page it comes back with data. So I'm happy there. Unfortunately, when I run it over a browser I get this error message
Parse error: syntax error, unexpected '=', expecting ',' or ')' in C:\Inetpub\wwwroot\uptime\result3.php on line 9
Here is my code from the results page:
<?php require_once('Connections/outages.php'); ?>
<?php
$box_dateoutages = "H50";
{
$box_dateoutages = (get_magic_quotes_gpc()) ? Request("box") : addslashes(Request("box"));
}
$box_dateoutages = "H50";
if (isset(#box#)) {
$box_dateoutages = (get_magic_quotes_gpc()) ? #box# : addslashes(#box#);
}
mysql_select_db($database_outages, $outages);
$query_dateoutages = sprintf("SELECT system.sys_name, downtime.date, downtime.description FROM downtime, system WHERE system.sys_name = '%s' and downtime.sys_id = system.sys_id", $box_dateoutages);
$dateoutages = mysql_query($query_dateoutages, $outages) or die(mysql_error());
$row_dateoutages = mysql_fetch_assoc($dateoutages);
$totalRows_dateoutages = mysql_num_rows($dateoutages);
?>
<?php require_once('Connections/outages.php'); ?>
<?php require_once('Connections/outages.php'); ?>
<?php
mysql_select_db($database_outages, $outages);
$query_alloutages = "SELECT system.sys_name, downtime.date, downtime.description FROM system, downtime WHERE downtime.sys_id = system.sys_id";
$alloutages = mysql_query($query_alloutages, $outages) or die(mysql_error());
$row_alloutages = mysql_fetch_assoc($alloutages);
$totalRows_alloutages = mysql_num_rows($alloutages);
mysql_select_db($database_outages, $outages);
$query_Recordset1 = "SELECT * FROM system ORDER BY sys_name DESC";
$Recordset1 = mysql_query($query_Recordset1, $outages) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_select_db($database_outages, $outages);
$query_Recordset2 = "SELECT * FROM downtime";
$Recordset2 = mysql_query($query_Recordset2, $outages) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #99CC66;
}
-->
</style></head>
<body>
<div align="center"></div>
<form name="form1" method="get" action="result3.php">
<table border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<td>sys_name</td>
<td>date</td>
<td>description</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $_GET['box']; ?></td>
<td><?php echo $row_dateoutages['date']; ?></td>
<td><?php echo $row_dateoutages['description']; ?></td>
</tr>
<?php } while ($row_alloutages = mysql_fetch_assoc($alloutages)); ?>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($dateoutages);
mysql_free_result($alloutages);
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>