Link to home
Start Free TrialLog in
Avatar of NHA
NHA

asked on

http_referer problem?

I added a button to my asp pages that simulate the back button function using http_referer but and it's working fine with my PC and with 2 other PC , but when i test it through other PC , it give problem , it make the navigation to go to a differnt page and I don't know why ?

is http_referer depend on some option on browser???

Avatar of thunderchicken
thunderchicken

If you want to simulate the back button, I would use the javascript back.

<a href = "javascript:history.back()"> Go back </a>
Questions  
Questions Asked 17
Last 10 Grades Given A A B A A C C  
Question Grading Record 7 Answers Graded / 7 Answers Received


Please keep up on your old questions.
NHA,

thunderchicken is right on!  It's best to use JavaScript to simulate the back button.  Perhaps yours isn't working becuase of the different computer?  HTTP_REFERER is not just just the script name and query string (SCRIPT_NAME and QUERY_STRING) but is the entire address i.e. http://blahblahblah.  I don't see right now why it would make a difference but it's all I can think of as a possibility without knowing more about the pages and the computers.

David
Avatar of NHA

ASKER

Thanks ...
but actually I want the page to be refrshed when he back to it , so I try location.replace(history.go (-1)) but the page does not refreshed ? I use location.href = http_referer and it's work fine ? and i don't know why it is couse problem on some machines ?

Go through and clean up your old questions and we will help.  I wont help anyone who doesn't award points for my work.
ok so use the

<button onclick="javascript:window.location('your file path as ../../folder or http://full path')"
Avatar of NHA

ASKER

Thanks giladboker....
    but I tried it and it didn't work , the page not refreshed, and also I need not to specify a certain path , I want it to go to the page that the user came from , so i need to use http_referer variable but this variable not worked correctly on some browsers so is there any other variables has the same value as http_referer.

ok.

try this..
when the user get the page save the url in a string.

put the string into a form title like so...
<form method="post" action="<%=String%>">


and make your back button as submit button.

<input type="submit" value="back">

this should refresh it on any browser

good luck
ok.

try this..
when the user get the page save the url in a string.

put the string into a form title like so...
<form method="post" action="<%=String%>">


and make your back button as submit button.

<input type="submit" value="back">

this should refresh it on any browser

good luck
Avatar of NHA

ASKER

Thanks....
   but this button will be a shared page on all pages so when I click on it it should go to the previous page and refresh the displayed page, I tried yr idea with history.go (-1) instead of string but still the page not refreshed and I doon't know why ?
Why can't you use giladBoker's suggestion?  Couldn't you just make the fomr in an include file and then include it on all of your pages?

This link isn't in an if, then statement is it?  It's just written out like <a href="Request.Servervariables("HTTP_REFERER")">link</a>, right?

David
Avatar of NHA

ASKER

Yes but http_referer cause problems on some machine ,I tested on 3 machine with IE 5.0 and windows 2000 and it's work fine but when i test it on 2 other machines one of them with windows xp ,it cause problem , it direct the user to wrong pages, I spent yesterday searching on http_referer and some guys said that it depend on the browsers and some of them said that it cause problem when using firewall , I can't understand why it's depend on the client and it's a server variables ? I'm thinking in a way to get the previous page without using http_referer , or find a way to make the browser accept http_referer ...

Avatar of NHA

ASKER

Yes but http_referer cause problems on some machine ,I tested on 3 machine with IE 5.0 and windows 2000 and it's work fine but when i test it on 2 other machines one of them with windows xp ,it cause problem , it direct the user to wrong pages, I spent yesterday searching on http_referer and some guys said that it depend on the browsers and some of them said that it cause problem when using firewall , I can't understand why it's depend on the client and it's a server variables ? I'm thinking in a way to get the previous page without using http_referer , or find a way to make the browser accept http_referer ...

Avatar of David H.H.Lee
All the server variable located in http://www.asp101.com/samples/servvars.asp.
No comment has been added lately and it seems that this question have been abandoned. So it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question or invite a Moderator to close this question if there's no reply from you after seven days.

In the absence of responses, I will recommend the following:

Question PAQ'D /No Refund

** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **


Just trying to help for the cleanup...
gladxml
ASKER CERTIFIED SOLUTION
Avatar of PashaMod
PashaMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial