FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Date





DanielXP
I have the following

Code:
$time = date("YmdHis");


How can i add $floodtime on to this?

I want it so like if the seconds is 59 it wont go to 69 coz theres only 60 seconds.

Or is there any better ways to do a flood protection?
muggle
Im not sure that Im getting you right, but you may take a look at this page:
http://us2.php.net/manual/en/function.time.php
SlowWalkere
When you use the date() function, either you have to supply a timestamp as the second parameter or the current time is used for you. If I understand you correctly, you want to get the current time plus 10 seconds saved. In that case, you can do this...
Code:
$time = date("YmdHis", time() + 10);

As for other ways of doing flood protection, I'm not sure. Haven't read enough about it to be of any use. However, if you're going to store that info ($time) in a database to check against future request times, why not just store it as a timestamp? Then you don't need to bother with the date conversion and math in seconds is easier.

Good luck,
- Walkere
DanielXP
Thanks SlowWalkere
coreymanshack
you could also say
<?php
if($seconds > 60){
$seconds=60;
//or whatever u want to do
}
?>
Related topics
10 Reasons to Date a Hockey Player
FTP - file last modified date
keep your adblocking up to date
When dating a new girl, how long do you wait before you kiss
PHP date() format for atom in php 4
A ActionScript,showing a running date.
Quels sous-forums aimeriez-vous avoir??
Date wrong on pc
Guess the Windows Vista Launch Date(Win Prizes!!!!)
Ten reasons you should date a geek
Is there a release date for ET:QW
mySQL - Day, date, month, year, time Output/Input
What date format do you prefere with MySQL?
date() function
What shouldn't you do/where shouldn't you take a first date?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.