<?php
//ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Cycle Tracks Portal - Validation Page</title>
<style type="text/css" media="all">@import "images/style.css";
</style>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
<script language="javascript">
redirTime = "5000";
redirURL = "index.php";
function redirTimer() {
self.setTimeout("self.location.href redirURL;",redirTime);
}
</script>
</head>
<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','');
mysql_select_db('administration');
// *** Validate request to login to this site.
//session_start();
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$loginPassword=$_POST['password'];
$MM_redirectLoginSuccess = "validated.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = true;
mysql_select_db('administration');
if(empty($_POST['username']) && empty($_POST['password'])) {
die('<div class="error_up">Both field was blank</div>
<br><br><div class="footer_padding">
© Copyright Cycle Tracks <span>®</span></div>
');
}
if(empty($_POST['username'])) {
die('<div class="error_up">Username field was blank</div>
<br><br><div class="footer_padding">
© Copyright Cycle Tracks <span>®</span></div>
');
}
if(empty($_POST['password'])) {
die('<div class="error_up">Password field was blank</div>
<br><br><div class="footer_padding">
© Copyright Cycle Tracks <span>®</span></div>
');
}
$loginUsername = get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername);
$password = get_magic_quotes_gpc() ? $password : addslashes($password);
$LoginRS_query = "SELECT username, password FROM adminprofile WHERE username='$loginUsername' AND password='$loginPassword'";
$LoginRS = mysql_query($LoginRS_query) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
echo "<script type='text/javascript'>location.href='$MM_redirectLoginSuccess';</script>";
}
else {
echo "redirTimer()";
}
}
?>
</body>
</html>
<?php
//ob_end_flush();
?>
I know the way i call the function is wrong in line 68, how do i call the js function?