Jump to content


Member Since 20 May 2008
Offline Last Active Oct 21 2014 12:48 AM

Topics I've Started

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:


$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");
	$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?


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?


.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:

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

I even tried it on localhost:

same no show.

help pls.


Alert Help

02 July 2013 - 11:33 AM

firstly, I dunno if I should post here or in php, but my issue seems to Br intertwined. I have a jQuery newsletter form and I want to add PHP validation in it. My problem is I want a jQuery pop to show if the subscription is unsuccessful.

meanwhile I have a modal window I'd like to use it with, but the problem is how to call the script as all .


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