Jump to content

Kill connection?


Azu

Recommended Posts

Can somebody please tell me how I can make php instantly close and not even send a response header so that a browser trying to connect will get error saying cannot connect to server?

Link to comment
Share on other sites

Thanks, that isn't quite it though; when I use die, it still sends the headers and stuff to the browser, and lets it know that my site is on.

 

I want to make it appear offline (not send ANY data back) when injection attacks etc are detected.

 

So that it would seem like my internet cord is unplugged.

 

So in their browser it says it failed to connect to server or whatever.

 

So that it appears that my website is offline.

Link to comment
Share on other sites

Not really possible by the time your request has gotten as far as php. best you could do would be send a 503 or something similar. eg;

 

header("HTTP/1.0 503 Service Unavailable");

 

To do what you have in mind, it would need to be handled at the firewall level.

Link to comment
Share on other sites

Okay thank you I will try that!

Just one more question.. is there a way to use PHP to add IPs to a blacklist on Jetico firewall, or a lightweight firewall that I can use just for this and won't interfere with my main firewall?

Link to comment
Share on other sites

  • 2 weeks later...
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.