Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2001 12:00:13 +0100
From:      "Mark Hughes" <mark@dvdnews.co.uk>
To:        "Beech Rintoul" <akbeech@anchoragerescue.org>
Cc:        <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Apache question
Message-ID:  <035001c12967$4dc549f0$e4a5fea9@mark2>
References:  <20010819195215.C285CD3@nebula.anchoragerescue.org> <030401c12914$9c0fcb10$e4a5fea9@mark2> <20010820035919.DB399D3@nebula.anchoragerescue.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sunday 19 August 2001 05:08 pm, you wrote:
> > With PHP you can put something like this:
> >
> > <?php
> > if ($test=strstr($HTTP_REFERER,"http://www.example.com/")) {
> >     header("Location: target_url");
> > }
> > ?>

> I tried that, but it doesn't work. Am I doing something wrong?
>
> <?php
> if ($test=strstr($HTTP_REFERER,"http://www.alaskadesign.com/")) {
> header("Location: http://www.anchoragerescue.org/redirect.html");
> }
> ?>
> <html>

What does happen? That looks syntactically correct....for testing, do a
"print $HTTP_REFERER" to check the variable is being set and what it is
being set to - it maybe the case that you have the option to set all
environment thingies (technical, moi?) into variables is turned off in your
php.ini (think it may be called track vars, the option, but I could be
wrong), in which case you need something like
$HTTP_SERVER_VARS["HTTP_REFERER"] in place of $HTTP_REFERER.

Hope this helps,
Mark


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?035001c12967$4dc549f0$e4a5fea9>