Code: Select all
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))
{
if ($info['status'] == 0)
{
echo "<meta http-equiv='refresh' content='index.php'>";
include('start.php');
}
else
{
echo "<meta http-equiv='refresh' content='index.php'>";
include('stop.php');
}
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
if(mysql_num_rows($checklogin) == 1)
{
$row = mysql_fetch_array($checklogin);
$email = $row['EmailAddress'];
$_SESSION['Username'] = $username;
$_SESSION['EmailAddress'] = $email;
$_SESSION['LoggedIn'] = 1;
echo "<meta http-equiv='refresh' content='0;index.php'>";
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
else
{
?>
<h1>Member Login</h1>
<p>Please either login below, or <a href="register.php">click here to register</a>.</p>
<form method="post" action="index.php" name="loginform" id="loginform">
<fieldset>
<label for="username">Username:</label><input type="text" name="username" id="username" /><br />
<label for="password">Password:</label><input type="password" name="password" id="password" /><br />
<input type="submit" name="login" id="login" value="Login" />
</fieldset>
</form>
<?php
}
?>
Code: Select all
if ($info['status'] == 0)
{
echo "<meta http-equiv='refresh' content='index.php'>";
include('start.php');
}
else
{
echo "<meta http-equiv='refresh' content='index.php'>";
include('stop.php');
}
I know that it's is keeping executing this everytime
Code: Select all
echo "<meta http-equiv='refresh' content='index.php'>";Thanks before hand.