Jump to content


Mr-Chidi

Member Since 20 May 2008
Offline Last Active Today, 02:09 AM

Topics I've Started

Why is this not loggin me in

25 October 2014 - 12:16 AM

Hi all. I'm really having an awful time. Pls what could be the problem with this cos i can login into my local server but cant login when i go live.

 

thanks

<?php    
if(isset($_POST['login'])){

$username=$_POST['username'];
$password=$_POST['password'];

$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

$pass = md5($password);


$stmt = $pdo->prepare("SELECT * FROM confirm WHERE username=:username AND password=:password");
$stmt->execute(array(
':username' =>$username,
':password' => $pass
));

if ($stmt->rowCount() ==1){
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;

header("location: ./account/");
exit();
}
else {
echo 'Invalid Username or Password';
}
    }
?> 

Locking user based on ip

20 October 2014 - 07:01 AM

I know something is wrong but dunno how to fix it. My intention is to lock user based on ip after 3 unsuccessful attempts. Its incrementing the login count but after 3 attempts, I just can't figure out how to lock the user and reset the value after some time.

I'd like a pointer towards the right/best thing to do should my code not be worthy.

Thanks and heres my code:

 <?php

$user_ip = $_SERVER['REMOTE_ADDR'];
$table_name = "loginattempts";

$query = "SELECT attempts FROM $table_name WHERE user_ip = '$user_ip'";
$result = mysql_query($query) or die("Invalid Login");

while($row = mysql_fetch_array($result)){
	$count = $row['attempts'];
}
if($count == 3){
	echo("Your login attempt is completed");
	
}else{
	$insert = "INSERT INTO $table_name WHERE user_ip = '$user_ip'";
	$result = mysql_query($insert);

	$update = "UPDATE $table_name SET attempts = attempts + 1 WHERE user_ip = '$user_ip'";
	$result = mysql_query($update);
}
$update = "UPDATE $table_name SET attempts = 0 WHERE lastlogin - NOW() = '60000'";
$result =  mysql_query($update);

?>

move table due in 10 days time

13 October 2014 - 10:51 PM

Hi all.
I have an issue and don't know how to go about it. I have a table that contains user orders. I want to move only orders that will be due in 10 days time to another table. How can I achieve that?

thanks

controlling progress meter/bar

25 June 2014 - 05:25 PM

Hi. how can I control a progress meter/bar to display errors when it failed to reach 100% or on getting to a point?

thanks

.htaccess not working

19 May 2014 - 02:14 AM

Hi all.

I dont knw why I still can't get it right after many tries.
The .htaccess just can't locate the .bypassed file.

On my domain I created a folder called hidden in my web root and this is my authfile path:
/www/hidden/.htpasswd

but still no show. pls what am I missing here.

I even tried it on localhost:
/www/my_folder/hidden/.htpasswd

same no show.

help pls.

thanks

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com