Solved

http_referer problem?

Posted on 2002-05-05
16
341 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

11 Experts available now in Live!

Get 1:1 Help Now