Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

retrieveing the web address and then passing it to the next page

Posted on 2005-03-10
7
Medium Priority
?
124 Views
Last Modified: 2010-05-18
What i need to do with either javascript or asp...

I am creating a searchable database for several types of properties (rental, sales etc... for my real estate website).
I would like to pull the current website by some script and then when I click search, it sends and the other page recieves that web address through some variable so when the user clcicks new search, the new search is reading the variable of the previous webpage and can send them back to it?

need some help on this one
0
Comment
Question by:javajamminman
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 13511305
the previous webpage is already available you don't need to add any script.  it's called the "referrer".  you can access it using javascript or php... so i guess you can also access it with asp.
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 13511360
in javascript, use this:
document.referrer

in php use this:
$_SERVER['HTTP_REFERER'];
0
 

Author Comment

by:javajamminman
ID: 13511541
cool, i'll try that with javascript
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:javajamminman
ID: 13512052
Question
If I do the above, and then I have my property search results listed and there are several pages with a next button to view the next list of properties, the referer property would no longer be helpful, so that is why i would need to store it in a variable and then pass it, so
I can create a variable with javascript to hold the original referer, all i need is some info on how to pass the variable from page to page?
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 2000 total points
ID: 13512532
ok, in this case you can do one of the following:

1) use a hidden form field and set its value to the value of the referrer using javascript.
2) use javascript to pass it as a url param:  mypage?ref=xyz (it will be visible to the user).
3) use a cookie to save the referrer.
0
 

Author Comment

by:javajamminman
ID: 13512554
Ahh, yeah let me try the hidden form field, I'm familiar with that
i'll let you know how it goes
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 13693805
<:°)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

571 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