Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

http_referer problem?

Posted on 2002-05-05
16
Medium Priority
?
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

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.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 informatio…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 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