Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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???

0
NHA
Asked:
NHA
  • 5
  • 3
  • 3
  • +4
1 Solution
 
thunderchickenCommented:
If you want to simulate the back button, I would use the javascript back.

<a href = "javascript:history.back()"> Go back </a>
0
 
thunderchickenCommented:
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
 
beegledCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
NHAAuthor Commented:
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
 
thunderchickenCommented:
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
 
giladBokerCommented:
ok so use the

<button onclick="javascript:window.location('your file path as ../../folder or http://full path')"
0
 
NHAAuthor Commented:
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
 
giladBokerCommented:
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
 
giladBokerCommented:
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
 
NHAAuthor Commented:
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
 
beegledCommented:
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
 
NHAAuthor Commented:
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
 
NHAAuthor Commented:
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
 
David H.H.LeeCommented:
All the server variable located in http://www.asp101.com/samples/servvars.asp.
0
 
gladxmlCommented:
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
 
PashaModCommented:
Per recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now