Unusual - I want to Slow down page laod

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chinnybeard
Forum Newbie
Posts: 1
Joined: Fri May 26, 2006 1:07 pm

Unusual - I want to Slow down page laod

Post by chinnybeard »

I want to slow down the page laod on one of my pages. An unusual request I kow, but I want to make sure that one IP address in particular finds browsing through my site annoying.

I don't want to ban the IP address, else the person will simply use a proxy. I want the person to think that all is fine and its prolly just the server thats slow.

Is there anyway that I can do this using PHP?
I'd be looking for a load time of around 2 - 5 minutes.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

run some sort of loop

Code: Select all

if($_SERVER['REMOTE_ADDR'] == 1.1.1.1){
    while($something that takes a while){
        // don't let page load
    }
}
User avatar
cdwhalley
Forum Newbie
Posts: 1
Joined: Fri Apr 21, 2006 5:54 am

Post by cdwhalley »

Also, you could use the sleep() function.[/url]
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

How about putting up a script that has endless form data collection that keeps posting back to itself. Something like 'You are on step 1 of 5328 steps'. And have it set up where when you get to like step 30, it automatically errors and starts back at 1 again. Then he'll never get into your site. Of course, this should be coupled with the if check that Ninja posted. But this fakes a time consuming task so that the user may not suspect that he is being harassed when in fact he is.
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

Code: Select all

echo "<script type='text/javascript'>
if('" . $_SERVER['REMOTE_ADDR'] . "' == '1.1.1.1') {
for(i=0;i<200;i++) {
alert('sup ladies');
}
}
</script>";
Post Reply