Azu Posted May 27, 2007 Share Posted May 27, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/ Share on other sites More sharing options...
MadTechie Posted May 27, 2007 Share Posted May 27, 2007 erm.. not sure what you mean by 'make php instantly close' but die; would work Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/#findComment-262573 Share on other sites More sharing options...
Azu Posted May 27, 2007 Author Share Posted May 27, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/#findComment-262582 Share on other sites More sharing options...
trq Posted May 27, 2007 Share Posted May 27, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/#findComment-262589 Share on other sites More sharing options...
Azu Posted May 27, 2007 Author Share Posted May 27, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/#findComment-262591 Share on other sites More sharing options...
Azu Posted June 9, 2007 Author Share Posted June 9, 2007 BTW how can I tell PHP to not send a header? I think that might work, and I'm pretty sure PHP can control headers.. o_o Quote Link to comment https://forums.phpfreaks.com/topic/53149-kill-connection/#findComment-271306 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.