Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Generating Server not found error to restrict perticular Ip address..
Old 05-14-2010, 09:31 AM Generating Server not found error to restrict perticular Ip address..
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi,

Here I need you to get the information as how can I increase server request time....or can generate server not found error....for the specific Ip...??

Is there any way....to do so????

Thanks for your kind attention.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-14-2010, 09:36 AM Re: Generating Server not found error to restrict perticular Ip address..
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
"Increase the server request time" means what exactly??

Sending a 404 response
PHP Code:
<?php
header
("HTTP/1.0 404 Not Found");
?>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-14-2010, 09:38 AM Re: Generating Server not found error to restrict perticular Ip address..
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
to increase the time passed to generate a page, simply use the php sleep() function, which makes PHP, well, sleep for a determined time period.
http://www.php.net/manual/en/function.sleep.php

And an "not found" error is simply an return code 404 sent from an header:
http://php.net/manual/en/function.header.php
PHP Code:
header('HTTP/1.0 404 Not Found');
exit(); 
and voila.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 05-14-2010, 10:20 AM Re: Generating Server not found error to restrict perticular Ip address..
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Quote:
Originally Posted by chrishirst View Post
"Increase the server request time" means what exactly??

Sending a 404 response
PHP Code:
<?php
header
("HTTP/1.0 404 Not Found");
?>
I mean browser will appear as working.....but it will not show any results...and browser will end the request....because calling time increased.

I hope, its clear...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 05-14-2010, 10:23 AM Re: Generating Server not found error to restrict perticular Ip address..
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Quote:
Originally Posted by tripy View Post
to increase the time passed to generate a page, simply use the php sleep() function, which makes PHP, well, sleep for a determined time period.
http://www.php.net/manual/en/function.sleep.php

And an "not found" error is simply an return code 404 sent from an header:
http://php.net/manual/en/function.header.php
PHP Code:
header('HTTP/1.0 404 Not Found');
exit(); 
and voila.
Thanks Tripy,

I am trying your suggestions as well.....will let you know once done.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 05-14-2010, 03:47 PM Re: Generating Server not found error to restrict perticular Ip address..
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
Quote:
Originally Posted by Isabella_Smith View Post
I mean browser will appear as working.....but it will not show any results...and browser will end the request....because calling time increased.

I hope, its clear...
I don't recommend increasing calling time. even if you used sleep it'll end up locking up some memory allocated for the script. which mean if there are many requests and say your response time is 5 minutes it could end up exhausting your server memory or if you are on shared hosting they may suspend you for eating the whole server memory.

I recommend the other way to just send 404 not found response. I use it my self many times. It is good also for SEO. if you need search engines to stop requesting some pages and remove them fastly from their index you can use this way.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");

Last edited by nayes84; 05-16-2010 at 04:26 AM..
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 05-14-2010, 05:32 PM Re: Generating Server not found error to restrict perticular Ip address..
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
I don't recommend increasing calling time.
I think it's a good idea, but maybe not via a sleep(), but an intermediate page that will not allow the form submission for a given time.

Increasing the time between login attempt at each errors can be a pretty effective way to discourage brute force logins.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Generating Server not found error to restrict perticular Ip address..
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25337 seconds with 12 queries