![]() Topic awaiting preservation: allowing a range of ip addresses (PHP) (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: Manassas VA, USA |
![]() Hello again all. |
Paranoid (IV) Inmate From: Canada, Toronto |
![]() 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 |
![]() I was under the impression that .htaccess would allow/deny, but not redirect based on ip. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() You can do that with a little help from mod_rewrite... |
Paranoid (IV) Inmate From: Lebanon |
![]() <? |
Nervous Wreck (II) Inmate From: Manassas VA, USA |
![]() 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 |
![]() 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 |
![]() I know I can use a simple if statement to get what i need. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() 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 |
![]() Makes sense. Thanks much. |