Jump to content

count


chriscloyd

Recommended Posts

<?php
echo 'Checking Admin  ';
ob_start();

for($i=1;$i<6;$i++)
{
echo $i.' ';
if ($i == 1) { $check_user = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."' "); }
if ($i == 2) { 
	$num_users = mysql_num_rows($check_user);
	if ($num_users > 0) {
		$error = 0;
	} else {
		$error = 1;
	}
}
if ($i == 3) {
	if ($error == 0) {
		$check_user2 = mysql_fetch_assoc($check_user);
	}
}
if ($i == 4) {
	if ($error == 0) {
		if ($check_user2['password'] == md5($_POST['password'])) {
			$error = 0;
		} else {
			$error = 1;
		}
	}
}
if ($i == 5) {
	if($error == 0) {
		echo '<br>Login Succesful.<br>
		Being Redirected To Admin Page.';
		$_SESSION['ccblog_admin'] = 'Chris Cloyd';
		//header("Location: index.php");
	} else {
		echo "<br>Could Not Log In.<br>
		Incorrect Information.<br>
		Being Redirected Back To The Home Page.";
		//header("Location: ../index.php");
	}
}
    ob_flush();
    flush();

    usleep(900000);
}

?>

Link to comment
https://forums.phpfreaks.com/topic/136136-count/#findComment-710028
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.