Jump to content

I'm making a new site


Gayner

Recommended Posts

going to be a prayre site..

 

like pray4 me dot com or whatever, i'll find a name..

 

but going to have people post pray requests and see what's up

 

I just need some type of flood control code, i dont want people to type in captcha.. but i also want them toonly beaable to post the upload submit button once every other 30seconds for each user session.,

Link to comment
https://forums.phpfreaks.com/topic/181537-im-making-a-new-site/#findComment-957589
Share on other sites

I'm confused. Are you asking people to build components of your site for you? If so, we have a freelance section for that. Otherwise, instead of asking for code, perhaps googling what you seek, and/or asking members to 'guide' you in the correct direction (such as what to take into consideration, what to research, etc..)

 

But as it stands, it sounds like you're just holding your hands out and expecting code to be dropped into them (metaphorically speaking of course).

Link to comment
https://forums.phpfreaks.com/topic/181537-im-making-a-new-site/#findComment-957628
Share on other sites

<?php
$last_time = $_COOKIE['last_hit_time'];
$now = time();
$wait = 5;
if(empty($last_time))
{
setcookie('last_hit_time', $now);
}
else
{
if(($last_time + $wait) < $now)
{
die();
}
else
{
setcookie('last_hit_time', $now);
}
}
?>

 

found this somewhere on the net may help u

Link to comment
https://forums.phpfreaks.com/topic/181537-im-making-a-new-site/#findComment-957861
Share on other sites

if (!isset($_SESSION)) {
    session_start();
}
// anti flood protection
if($_SESSION['last_session_request'] > time() - 30){
    // users will be redirected to this page if it makes requests faster than 2 seconds
    header("location: /flood.html");
    exit;
}
$_SESSION['last_session_request'] = time();

 

this is best 1

Link to comment
https://forums.phpfreaks.com/topic/181537-im-making-a-new-site/#findComment-957865
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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