Problem with HTTP_REFERER and the Navigation

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
kopfteam
Posts: 13
Joined: Sun 17. Jul 2005, 14:39
Location: Munich, Germany
Contact:

Problem with HTTP_REFERER and the Navigation

Post 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
Pappnase

Post 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!?
kopfteam
Posts: 13
Joined: Sun 17. Jul 2005, 14:39
Location: Munich, Germany
Contact:

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9914
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

sounds like norton firewall/internet security.

Do not use Referer var of PHP - try

Code: Select all

$_SESSION['REFERER_URL']
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
susi
Posts: 33
Joined: Tue 19. Jul 2005, 11:14

$_SERVER["REFERER_URL"]

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9914
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

new dev release does not use REFERER anymore. So this problem can have effects in older releases only.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
susi
Posts: 33
Joined: Tue 19. Jul 2005, 11:14

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9914
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
susi
Posts: 33
Joined: Tue 19. Jul 2005, 11:14

Post 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....

:?:
User avatar
Oliver Georgi
Site Admin
Posts: 9914
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply