Ive created a script that looks at a database for certain things while refreshing every 15 or 5 mins depending on what its doing...
Now the script was working, now it wont laod in mozilla and IE sees it but wont refresh...
code:
<html>
<?
include('cfg.php');
$timestamp = date("F j, Y, g:i a");
$gettime = date("g:i a");
$hour = date("g");
$min = date("i");
$ampm = date("a");
$connect = mysql_connect($hostname, $user_name, $user_pass) or
die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
$db = mysql_select_db($database, $connect) or
die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
$testit = "Derrick";
$sql2 = "SELECT * FROM wait WHERE WUser = '$testit'";
$results = mysql_query($sql2, $connect);
if (mysql_num_rows($results) == 0) {
$sql = "INSERT INTO wait SET
WDate = '".$timestamp."',
WTime = '".$gettime."',
WTimeout = '".$hour.":".($min + 5)." ".$ampm."',
WUser = '".$testit."'";
$sql_result = mysql_query($sql, $connect) or
die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
}
while ($row = mysql_fetch_array($results)){
$timeout = $row["WTimeout"];
$timein = $row["WTime"];
$green_lite = $row["WOk"];
}
if ($gettime == $timeout) {
//Delete Record
mysql_query("DELETE FROM wait WHERE WUser='".$testit."'");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="15;url=3.php">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#52748F" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p> </p><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="wait">All Operators are busy!<br>
By keeping this window open, will retry your call.</td>
</tr>
</table>
<?
return;
}
if ($green_lite == "ok") {
?>
<head>
<meta http-equiv="refresh" content="0;url=1.php">
</head>
<?
} else {
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="5;url=3.php">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#52748F" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p> </p><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="wait">Please wait until a tech has connected your
call...<br>
Time Started: <? echo $timein; ?> Timeout: <? echo $timeout; ?></td>
</tr>
</table>
<?
return;
}
//}
mysql_close($connect);
?>
</html>