does a function exist...?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

does a function exist...?

Post 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]
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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.
Beans
Forum Commoner
Posts: 49
Joined: Mon Dec 23, 2002 3:06 am
Location: Manila, Philippines
Contact:

Post by Beans »

Doesn't Apache handle that? Or does Apache only get the referring URL?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

only referring link i think, javascript maybe able to that...maybe.
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

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

Post 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.
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post 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...
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

didn't think so

Post 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.
Post Reply