Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Dave Carrera
Jay Blanchard wrote: [snip] Is there a way of sending users with a local ip address say 127.0.0.1 and 192.168.xxx.xxx to goto one page and all other visitors to goto another? [/snip] Yes, there is. $_SERVER['REFERER'] will give you the referer mosy of the time. More info from TFM can be

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Zareef Ahmed
Hi Dave, You can look for the value of $_SERVER['REMOTE_ADDR'], and then you can serve users as per your preferences. Zareef Ahmed - Original Message - From: Dave Carrera [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, December 13, 2005 11:06 AM Subject: [PHP] 1 ip

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Duncan Hill
On Tuesday 13 December 2005 16:13, Jay Blanchard wrote: $_SERVER['REFERER'] will give you the referer mosy of the time. More info from TFM can be found here; REFERER is the URL the client came from though, not the local IP address of the client. Methinks the OP wants REMOTE_ADDR. -- PHP

RE: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Jay Blanchard
[snip] snip from TFM 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread David Grant
Try $_SERVER['REMOTE_HOST'] instead of REFERER. Dave Carrera wrote: Jay Blanchard wrote: [snip] Is there a way of sending users with a local ip address say 127.0.0.1 and 192.168.xxx.xxx to goto one page and all other visitors to goto another? [/snip] Yes, there is.

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread John Nichel
Dave Carrera wrote: Jay Blanchard wrote: [snip] Is there a way of sending users with a local ip address say 127.0.0.1 and 192.168.xxx.xxx to goto one page and all other visitors to goto another? [/snip] Yes, there is. $_SERVER['REFERER'] will give you the referer mosy of the time. More

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Dave Carrera
i know about $_SERVER['REMOTE_HOST'] but i think i should of said how do i compare any address starting with 192.168. sorry if my first question was to vague David Grant wrote: Try $_SERVER['REMOTE_HOST'] instead of REFERER. Dave Carrera wrote: Jay Blanchard wrote: [snip] Is

RE: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Dan Parry
REMOTE_ADDRESS would be favourite -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED] Sent: 13 December 2005 16:23 To: Jay Blanchard Cc: php-general@lists.php.net Subject: Re: [PHP] 1 ip address go here all others go here Jay Blanchard wrote: [snip] Is there a way of sending users

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Jochem Maas
Dave Carrera wrote: Jay Blanchard wrote: [snip] Is there a way of sending users with a local ip address say 127.0.0.1 and 192.168.xxx.xxx to goto one page and all other visitors to goto another? [/snip] snip from TFM 'HTTP_REFERER' The address of the page (if any) which

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread David Grant
Quick and (very) nasty: $parts = split(., $_SERVER['REMOTE_HOST']); if ($_SERVER['REMOTE_HOST'] == '127.0.0.1' || ($parts[0] == '192' $parts[1] == '168')) { // Local } else { // Remote } Dave Carrera wrote: i know about $_SERVER['REMOTE_HOST'] but i think i should of

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread David Grant
Erm, REMOTE_ADDR, not REMOTE_HOST. Sorry! David Grant wrote: Quick and (very) nasty: $parts = split(., $_SERVER['REMOTE_HOST']); if ($_SERVER['REMOTE_HOST'] == '127.0.0.1' || ($parts[0] == '192' $parts[1] == '168')) { // Local } else { // Remote } Dave Carrera wrote:

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Dave Carrera
Thanks David, Thats the kind of thing i was looking for. Onwards and upwards ;-) Dave C David Grant wrote: Quick and (very) nasty: $parts = split(., $_SERVER['REMOTE_HOST']); if ($_SERVER['REMOTE_HOST'] == '127.0.0.1' || ($parts[0] == '192' $parts[1] == '168')) { // Local } else {

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Ray Hauge
That would be something along the lines of: preg_match(/^192\.168/,$_SERVER['REMOTE_HOST']); I'm a little rusty on my regex, but that should do it. Dave Carrera wrote: i know about $_SERVER['REMOTE_HOST'] but i think i should of said how do i compare any address starting with 192.168.

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Duncan Hill
On Tuesday 13 December 2005 16:33, Dave Carrera wrote: $_SERVER['REMOTE_HOST'] but i think i should of said how do i compare any address starting with 192.168. REMOTE_HOST contains the resolved DNS name of an IP address. This value is dependent on your web server doing DNS resolution (and

Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Ray Hauge
Oops... REMOTE_ADDR should have been used. Ray Hauge wrote: That would be something along the lines of: preg_match(/^192\.168/,$_SERVER['REMOTE_HOST']); I'm a little rusty on my regex, but that should do it. Dave Carrera wrote: i know about $_SERVER['REMOTE_HOST'] but i think i should