Topic awaiting preservation: allowing a range of ip addresses (PHP) (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: Manassas VA, USA |
posted 06-06-2002 09:20
Hello again all. |
Paranoid (IV) Inmate From: Canada, Toronto |
posted 06-06-2002 17:17
Before you try PHP, have you given any thought about using .htaccess solution. I think it is a file that should solve your problem. |
Nervous Wreck (II) Inmate From: Manassas VA, USA |
posted 06-06-2002 21:56
I was under the impression that .htaccess would allow/deny, but not redirect based on ip. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-06-2002 23:26
You can do that with a little help from mod_rewrite... |
Paranoid (IV) Inmate From: Lebanon |
posted 06-07-2002 10:24
<? |
Nervous Wreck (II) Inmate From: Manassas VA, USA |
posted 06-07-2002 22:27
That pattern works in general to make sure the ip is in the right general format (000.000.000.000), and i can check the individual parts, but.... |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-07-2002 23:13
Regular expression that Lallous posted above will split specified IP address and store the results in $results array which you can use to check if IP address is in the spcified range... |
Nervous Wreck (II) Inmate From: Manassas VA, USA |
posted 06-08-2002 09:33
I know I can use a simple if statement to get what i need. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-08-2002 14:55
Just stick with if statements. Regular expressions don't support number ranges (as you already know), and therefore constructing regex that will match certain range of number would be a little bit tricky (you would need to use a lot of alternative patterns - " |
Nervous Wreck (II) Inmate From: Manassas VA, USA |
posted 06-09-2002 03:39
Makes sense. Thanks much. |