Re: URLS

From: Date: Mon, 07 Oct 2002 23:06:23 +0000
Subject: Re: URLS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-119155@lists.php.net to get a copy of this message
a little idea to make it nice..... For example you would like http://www.danceportal.co.uk/home/1234567 (looks better without ?). Create a directory /home and put a .htaccess in it wich calls a php-script when a 404-error happens. In the php-script you can parse the 1234567 out of the url. $id = preg_replace("/.+\/([0-9])$/", "\\1", _SERVER["REQUEST_URI"]); should do this. Now you can process whatever you want with the id and then make a simple http-redirect to your index.php4 with header(). Thomas 'Neo' Weber --- thomas@youngarts.org neo@gothic-chat.de ----- Original Message ----- From: "Randum Ian" <ian@randumian.co.uk> To: "'Jonathan'" <js-lists@sharpmedia.net> Cc: <php-general@lists.php.net> Sent: Tuesday, October 08, 2002 12:44 AM Subject: RE: [PHP] URLS > I was hoping that I could hide the '.php' part so that people don't see > that bit on the URL. > > -----Original Message----- > From: Jonathan [mailto:js-lists@sharpmedia.net] > Sent: 07 October 2002 18:40 > To: Randum Ian > Cc: php-general@lists.php.net > Subject: Re: [PHP] URLS > > Ref: http://us2.php.net/manual/en/reserved.variables.php > > $_SERVER['QUERY_STRING'] will be filled with whatever is after the '?' > > So you can do urls like this: > http://www.yourpage.com/home.php?832784387342 > > and $_SERVER['QUERY_STRING'] will contain 832784387342 > > -js > > > > Randum Ian wrote: > > So I create a page called 'Home' and then I call this from inside it > > after making PHP read it? > > > > -----Original Message----- > > From: Jonathan [mailto:js-lists@sharpmedia.net] > > Sent: 07 October 2002 18:15 > > To: Randum Ian; php-general@lists.php.net > > Subject: Re: [PHP] URLS > > > > use $QUERY_STRING > > > > -js > > > > > > Randum Ian wrote: > > > >>Hi there, > >> > >>I want to be able to invite people to my websites by using a link like > >>so: > >> > >>http://www.danceportal.co.uk/Home?1234567 > >> > >>The '1234567' number is a referral number so that I can track > > > > referrals. > > > >>How do I then get the number into this webpage? > >> > >>http://www.danceportal.co.uk/Home/index.php > >> > >>Please advise, > >>Randum Ian > >>ian@randumian.co.uk > >>DJ / Reviewer / Webmaster, DancePortal (UK) Limited > >>DancePortal.co.uk - Global dance music media > >> > >> > >> > >> > > > > > > > > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#119155) next »