Page 1 of 1

Problem with HTTP_REFERER and the Navigation

Posted: Tue 26. Jul 2005, 15:47
by kopfteam
I have a strange Problem:

Please go to http://www.iagcp.org enter the site and click on "Member Area". The Name and the Password are "test". You see a list of countries.

The 4th Line on the screen is a link labled "Hotels". Click on it. On the resulting page you see that HTTP_REFERER is OK.

Go back. Click on "Member Hotels" in the Navigation (exact same href as the link before). On my Mac you get exactly the same result as before with the link. On Windows with IE6 you get an empty referer (and the page doesn't work).

What is happening with HTTP_REFERER when using IE6? And why only in the navigation and not with a standard link?

Cache is off for "Member Area", "Member Hotels" and "Member Clubs" for both - the articles and in the structure.

Any ideas?
Florian

Posted: Wed 27. Jul 2005, 04:40
by Pappnase
hello

wich kind of content part did you use?

and why you dont make simple redirects to an blank page for each level!?

Posted: Wed 27. Jul 2005, 11:55
by kopfteam
Hello Pappnase,

thanks for your fast answer. The content part is "ext. content".

I use the HTTP_REFERER to find out where the user is coming from: I he is coming from "somwhere else" I redirect him to the password page. If he is coming from "inside" then he has already entered the correct password and I simple show the requested page.

Again, everything works with Safari/Firefox/Camino on the Mac and with Firefox on Windows. The HTTP_REFERER is empty with IE6 on windows, but only if I click on "Member Hotels" in the navigation. If I use the selfmade link the HTTP_REFERER is correct. So I think it is neither a problem of the browser not of my PHP script but a problem with the phpwcms navigation and IE6.

What's happening there?

Florian

Posted: Mon 1. Aug 2005, 15:15
by Oliver Georgi
sounds like norton firewall/internet security.

Do not use Referer var of PHP - try

Code: Select all

$_SESSION['REFERER_URL']
Oliver

$_SERVER["REFERER_URL"]

Posted: Mon 22. Aug 2005, 17:06
by susi
hi,
I read this article and testet $_SERVER["REFERER_URL"] in my phpwcms project. it doesn't work. the var is empty.
I tried a lot of things to save the referer-url for the next site.
see my question: http://www.phpwcms.de/forum/viewtopic.php?t=8234 .
another possibility, I think, is to save the url in a session-var. but it doesn't works too. for my understanding: I excpect, session is activated from phpwcms-system? or should I start in header with session_start() (on the otherside - I also tried this without success)?
do you have a tip for me?
thanks,
susi

Posted: Mon 22. Aug 2005, 18:08
by Oliver Georgi
new dev release does not use REFERER anymore. So this problem can have effects in older releases only.

Oliver

Posted: Mon 22. Aug 2005, 22:08
by susi
o.k., but is there a solution? there must be a solution, I think?!
how can I take the url to the next site?
maybe it's a stupid question, but I can't solve the problem :(
please give me a hint.
gruß,
susi

Posted: Mon 22. Aug 2005, 22:23
by Oliver Georgi
in current release phpwcms is opening a session for each user. So you can store current site and take over session var as Referer value:

check and enhance thisn peace of code

Code: Select all

define('ACTIVE_REFERER', empty($_SESSION['REFERER_URL']) ? PHPWCMS_URL.'index.php?'.$_SERVER['QUERY_STRING'] : $_SESSION['REFERER_URL']);
$_SESSION['REFERER_URL'] = PHPWCMS_URL.'index.php?'.$_SERVER['QUERY_STRING'];
Oliver

Posted: Wed 24. Aug 2005, 08:27
by susi
hi oliver,

thanks for answere, but I don't understand what you mean (sorry, I'm not very experienced) :cry:

I implemented your piece of code and I get the actual URL. it's the same result as I tried it with $GLOBALS['_SERVER']['REQUEST_URI'].
so, I tried then to store it in session with:

session_start();
define('ACTIVE_REFERER', empty($_SESSION['REFERER_URL']) ? $PHPWCMS_URL.'index.php?'.$_SERVER['QUERY_STRING'] : $_SESSION['REFERER_URL']);
$_SESSION['REFERER_URL'] = $PHPWCMS_URL.'index.php?'.$_SERVER['QUERY_STRING'];
$url = $_SESSION['REFERER_URL'];
session_register("url");

but it seems so, the var will not store in session. when I call var in next site, I get nothing....

:?:

Posted: Wed 24. Aug 2005, 10:49
by Oliver Georgi
you need PHP experience to have it working. Your code is not nice. I can not see what you really want to do. if I set
$_SESSION['varname'] then THIS is the session var you have access on. So use it like

Code: Select all

echo $_SESSION['varname'];
Oliver