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
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
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
[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
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.
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
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
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
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
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
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:
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 {
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.
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
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
15 matches
Mail list logo