Jump to content

flood controll help cheers.


redarrow

Recommended Posts

Can you help please.

I am trying to inplerment a flood time feature,
if the time is more then 1 min do somethink else wait.

Somethink is wrong with $new_time wrote wrongly cheers.
[code]
<?


$time=("h:i:s");


$new_time=list( date("h") , date("i")+1 , date("s") );


if( $new_time > $time ) {

do somethink

} else {

echo "sorry you got to wait 1 min"

}


?>
[/code]
Link to comment
Share on other sites

[!--quoteo(post=385507:date=Jun 19 2006, 03:34 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 19 2006, 03:34 AM) [snapback]385507[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Think about what your doing here and try again.
[/quote]

Is that correct dont know lol cheers.
[code]
<?


$time=date("h:i:s");


$new_time=date("i")+1;


if( $new_time > $time ) {

do somethink

} else {

echo "sorry you got to wait 1 min"

}


?>
[/code]
Link to comment
Share on other sites


This example works in minites but not in full time.
[code]
<?

$time=date("i");


$new_time=date("i")+1;


if($new_time > $time) {

echo"do somethink";

} else {

echo "sorry you got to wait 1 min";

}

?>
[/code]

how can i add +1 to i in this format cheers
[code]
<?

$time=date("h:i:s");

//here ("h:i:+1s") wont let me add the 1 to i how lol,
$new_time=date("i")+1;


if($new_time > $time) {

echo"do somethink";

} else {

echo "sorry you got to wait 1 min";

}

?>
[/code]
Link to comment
Share on other sites

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--]

[code]
<?

$time=date("h:i:s");

$a=date("i")+1;

$new_time=date("h:$a:s");

if($new_time > $time) {

echo"do somethink";

} else {

echo "sorry you got to wait 1 min";
exit;

}

?>
[/code]
Link to comment
Share on other sites

I'm curious if this code can really get to the else section!!!???

Let me guess. You assign a time variable with date function. And then you assign an another time variable with one minute later. And you check if the new time (which is 1 minute higher then the old one) is bigger then the old time! Can this code get to the else section?

And also you will get a 60th min if the post is at the 59th min! Just read carefully the date function because what you define in ' " ' is the format of the date! Use date("m-d-Y",mktime(blabla)) to define a newer date.

Still this function can't control the time problem. It should get from somewhere the last operation time to be able to check the time interval between the old calling of the file and the new one!

Long story short I think that your code should be something like:
[code]
if ( date("h:a:s") - $_GET['oldtime'] < 1 )
{
echo "please wait a minute";
exit();
}
else{
echo "dosomething";
}
[/code]


Just think the logic of your code a little bit too.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.