HTTP_REFERER

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
rudeboy
Posts: 16
Joined: Wed 19. Nov 2003, 21:19

HTTP_REFERER

Post by rudeboy »

as i understood apache gets the value HTTP_REFERER from the browser. this value often is not correctly send by the browser (primary ie). inside the admin section i often found a

Code: Select all

$ref = $_SERVER['HTTP_REFERER'];
header("Location: ".$ref);
it would be great if the forward would work like this

Code: Select all

header("Location: /phpwcms.php?do=admin&p=x");
i started to change the source, but stopped because i thought proably you will implement this for much better browser compatibility. if it's like the first code the action will be done but you end on a directory listing.
greetings marc
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

I had never problems with that.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
rudeboy
Posts: 16
Joined: Wed 19. Nov 2003, 21:19

Post by rudeboy »

hi again

i quickly lookedup goolge an found this explanation in the php manual under http://www.phpfreaks.com/phpmanual/page ... ables.html
or http://ch.php.net/reserved.variables

'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 be trusted.

e.g. sometimes (somebrowser) it works, othertimes it won't. i using xp ie 6.0 all patches and this error occurs. with mozilla or netscape i don't have this. tried on other confgurations (win2000 ie6, win98 ie6) and i had the trouble on all of them :(. do you think it would be much work to have everywhere a clean redirect to the correct page?
greetings marc
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Yes! This makes a lot of work.

You should check your configuration - on none of every tested Browser I have seen such problems. Maybe cookie or something else might be the problem for you. For using backend your should be more lazy with that.

These are the browser I have tested with:
PC: IE 5, 5.5, 6 (all versions), Mozilla 1.3, 1.4, 1.5
Mac: Safari, IE5 (MacOS 9 + MacOSX)

Hm.
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

What's the need of 'HTTP_REFERER'?
Maybe we can work with 'REQUEST_URI' in combination with streplace();.

I don't have any Probs with the Referer, yet. I use a lot of different browsers.

Hmmmm
Florian

BTW: rudeboy: take a look in the IE6 security setting, there should be a field, which disable the referer sending, when checked.
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

A little more description:

A lot of forms will not send POST vars to the page itself - like updating, edit, delete or something else. I use the files in inc_act. These files processes the given data and then I use HTTP_REFERER to go back. So every URI value of the sender page stays. This should handle double sending of db entries by double clicking or make reload of the page. Only then the post var cache of your browser is deleted. I find this very useful.

And most the form action URI differs to the HTTP_REFERER URI.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

Hello,

thanks for the small tecnical description.
So I think it's much more compatible to give a hidden field with the posted form where the REQUEST_URI is stored. At the next page we have only to change the header: $var with the name of the hidden field where the REQUEST_URI is stored. What do you think? I will build this if you share my thoughts ;)

Cheers,
Florian
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Good idea Florian,

but I think we should wait with such code change until the translation of backend is started. I have planned to begin with translation next week's weekend.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

Hello,

no hurry Oliver. I know that such a project is a truckload of work. You did untill now a really great job :).
I think most of the people who use WCMS are able to help themselfes if a bug occur esp. to fix this bug.

Cheers,
Florian
Locked