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

Posted on 2005-03-10
Medium Priority
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
Question by:javajamminman
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
  • 4
  • 3
LVL 30

Expert Comment

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.
LVL 30

Expert Comment

ID: 13511360
in javascript, use this:

in php use this:

Author Comment

ID: 13511541
cool, i'll try that with javascript
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users


Author Comment

ID: 13512052
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?
LVL 30

Accepted Solution

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.

Author Comment

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

Expert Comment

ID: 13693805

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

765 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