?
Solved

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

Posted on 2005-03-10
7
Medium Priority
?
122 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
[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
  • 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
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

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

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