How to track the referring URL of a pop-up window...?

They have: 2 posts

Joined: Sep 2002

This has been a headache for at least a week now. I have a "Mail This Page to a Friend" perl script that works only when the user fills out the form in the same window. I want it to be a pop-up window, but when I try this, the URL value is lost. Everything else works fine.

Currently it is retreiving the URL using the good old $ENV{'HTTP_REFERRER'} value.

I have tried a few different CGI and Javascript methods to no avail. Can anyone help me out here?

Dust

Busy's picture

He has: 6,151 posts

Joined: May 2001

wouldnt you want the url of the window with the form, not the pop up window? because if you passed on a pop up window url it wont work very well.
anyway, you could pass the previous url by variable, using a session or tagged on to the end of the URL

They have: 2 posts

Joined: Sep 2002

No the form is IN the pop-up window. The user clicks on "SEND THIS PAGE TO A FRIEND" and then a pop-up window leads them through the rest.

This is what I have currently and what SHOULD work:


IMAGE TAG

That should just pass the current URL along as the variable "url" to the script. It could be a script problem, but I doubt it because I got it from an outside source. Does this look to be a problem with my cgi script or is there an error in the above tag?

dk01's picture

He has: 516 posts

Joined: Mar 2002

I would use a function personally.
eg.
(this part in the )
<script language="Javascript" type="text/javascript">
function SendToFriend() {
var thePlace = 'http://www.domain.com/cgi-bin/mailpage.cgi?page=' + document.location.href;
TheNewWin=window.open(thePlace,'TheNewpop','width=640,height=860')
</script>

(this would be your link)

IMAGE TAG

I hope that solves the problem.
-dk

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.