|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP: IP Redirection
Hi, I was wondering if I can make a statement so that if a user is using a certain IP or is on a certain IP, I can make them see something else rather than what is normal for the page they try to access.
For example, everyone else accesses my site, normally. But say there is a malacious user or someone you hate and you just want him to stay out of the site, then what do you do? Can you make an IF statement or something that checks for IP address? I am really hoping this can be possible without the use of MySQL. For the 'bad' person I want them to see something other than normal and everyone else will be unaffected. Is this even possible? Thanks ahead of time. |
|
#2
|
|||
|
|||
|
RE: PHP: IP Redirection
***CANT EDIT MY OWN POST***
What is the code for this? I've seen it done before... |
|
#3
|
|||
|
|||
|
RE: PHP: IP Redirection
Make a textfile called "block.txt"
Insert on every line an IP address you want to block. |
|
#4
|
|||
|
|||
|
RE: PHP: IP Redirection
Where it says YOUR BLOCKED how would I send them and html page instead?
|
|
#5
|
|||
|
|||
|
RE: PHP: IP Redirection
instead of exit("You are blocked");
use header('Location: http://yoursite.com/blocked.html'); exit(); To use the header() function you have to make sure no other contents is send before. So you have to either put the code jorgen posted on the very top of your PHP script or use output buffering. |
![]() |
| Viewing: Codewalkers Forums > Forum Information > Suggestions & Feedback > PHP: IP Redirection |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|