Re: Newbie question about links

From: Date: Thu, 14 Feb 2002 12:04:22 +0000
Subject: Re: Newbie question about links
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84725@lists.php.net to get a copy of this message
On Wednesday 13 February 2002 03:13, Chris Schoeman wrote: > I want to make links on my website which doesn't show the original url of > that page. > How Can I do that? Have your links of the form: htpp://www.mydomain.com/linkto.php?id=123 Then in linkto.php you need to redirect (using header()) to the appropriate URL. Something like: <? $LINKS = array("123" => "www.doo.com", "124" => "www.dah.com/doodah.html"); if ($LINKS[$id]) { $link = $LINKS[$id]; header("Location: http://$link"); } else { echo "Invalid link!"; } ?> -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* It occurred to me lately that nothing has occurred to me lately. */

« previous php.general (#84725) next »