Current location: Hot Scripts Forums » Programming Languages » PHP » Php time checking problem

Php time checking problem

Reply
  #1 (permalink)  
Old 11-02-09, 01:24 AM
Zeast Zeast is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Php time checking problem

Hi guys,

I am working on accounts application, my client needs a login check like if a user comes on site and login with invalid usrename or password ill save the ip address of user and time of attempt in timestamp.

now i want to check if a user attempted 10 times in last 10 minutes with same ip then i will block his/her ip for ten minutes.

all the work is done just getting problem in getting last 10 minutes time. how can i get the time of last 10 minutes.

Any help will be appriciated

Thanks

Regards
Abdur Rehman
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-03-09, 12:11 PM
abracadaver's Avatar
abracadaver abracadaver is offline
Newbie Coder
 
Join Date: Oct 2009
Location: Katy, TX
Posts: 13
Thanks: 0
Thanked 2 Times in 2 Posts
Several ways I'm sure. Here are two:

Code:
$ten_minutes_ago = time() - 600;
Code:
$ten_minutes_ago = strtotime("-10 minutes");
-Shawn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-07-09, 05:04 PM
NewsBlaze NewsBlaze is offline
New Member
 
Join Date: Nov 2009
Location: California
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
php time manipulation is easy

It really depends how you want to check it but as abracadaver showed, you can easily do math operations on time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-12-09, 12:35 PM
stuart33millar stuart33millar is offline
New Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks guys, i too was having the same problem with my site before
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
login check, php, time difference


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: PHP Parse error: syntax error, unexpected T_STRING joerg_jb PHP 3 07-29-09 01:46 PM
Does PHP Slow Down Website Loading Time? KeYBLeR PHP 7 02-17-06 07:23 PM
PHP form problem jonnekke PHP 6 10-21-05 03:51 AM
PHP script problem (please help) osmanmumtaz PHP 0 05-24-05 07:29 AM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM


All times are GMT -5. The time now is 11:01 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.