Page 1 of 1

does a function exist...?

Posted: Thu Jan 02, 2003 10:37 am
by uberpolak
Is there any way to get the URL someone is leaving a page to go to? ie if one were going from zork.com to megazork.com, could a script be run on zork.com that would somehow return the value megazork.com? thanks for any input[/quote]

Posted: Thu Jan 02, 2003 4:05 pm
by qads
you could make a script for it.

Code: Select all

<?php
//goto.php
if(isset($_GET[goto]))
{
//save in db table
$insert = mysql_query("insert into table ('','$_GET[goto]')");
header(Location: $GET[goto]);
}

?>
put the above code in a page and link to it like: <a href="page.php?goto=www.url.com">url</a>

makesure you have a db table for saveing that info.

Posted: Fri Jan 03, 2003 12:19 am
by Beans
Doesn't Apache handle that? Or does Apache only get the referring URL?

Posted: Fri Jan 03, 2003 4:40 am
by qads
only referring link i think, javascript maybe able to that...maybe.

I see what you're doing, but...

Posted: Fri Jan 03, 2003 9:59 am
by uberpolak
That's not really what I'm trying to do, I want to know where the user is going regardless of whether or not they click a link from my site. I don't even know if this is possible but I mean like if they type something in the location bar or something.

Posted: Fri Jan 03, 2003 10:03 am
by Elmseeker
I don't think you can find out what they type in the address bar and if you could it would be a MAJOR security risk because if you can find out what they type there you can find out what they type other places, like password boxes and such...nono this is a BAD idea...

didn't think so

Posted: Fri Jan 03, 2003 1:13 pm
by uberpolak
I didn't think it would exist, oh well worth a shot, for the record though I'm not trying to capture keystrokes or anything, I just wanted the address they were leaving my site to. Oh well, I've found a way to do this with javascript now so it's all good.