Solved

http_referer problem?

Posted on 2002-05-05
16
340 Views
Last Modified: 2006-11-17
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???

0
Comment
Question by:NHA
  • 5
  • 3
  • 3
  • +4
16 Comments
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6990400
If you want to simulate the back button, I would use the javascript back.

<a href = "javascript:history.back()"> Go back </a>
0
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6990401
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.
0
 

Expert Comment

by:beegled
ID: 6990859
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
0
 

Author Comment

by:NHA
ID: 6990918
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 ?

0
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6992175
Go through and clean up your old questions and we will help.  I wont help anyone who doesn't award points for my work.
0
 
LVL 1

Expert Comment

by:giladBoker
ID: 6994564
ok so use the

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

Author Comment

by:NHA
ID: 6995595
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.

0
 
LVL 1

Expert Comment

by:giladBoker
ID: 6995772
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
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Expert Comment

by:giladBoker
ID: 6995789
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
0
 

Author Comment

by:NHA
ID: 6995920
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 ?
0
 

Expert Comment

by:beegled
ID: 6995960
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
0
 

Author Comment

by:NHA
ID: 6995970
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 ...

0
 

Author Comment

by:NHA
ID: 6995985
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 ...

0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 8739055
All the server variable located in http://www.asp101.com/samples/servvars.asp.
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8795867
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
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8858469
Per recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now