News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Quate Newsnet:
Shorter URLs Using PHP
June 03, 2006 @ 12:09:03

On the Quate Newsnet site, there's this handy little tutorial (from Chris) with a look at creating shorter URLs with the help of PHP - that is, "page.php?1&2" versus "page.php?id=1&page=2".

This script is useful for those who can't use a htaccess file for one reason or another. (Some hosting providers do not allow htaccess use.) Also useful for those PHP developers who are striving to create a very universal program, and want to offer shorter URLs without the requirement of the user having to use a htaccess file.

The actual PHP code for it is pretty simple, grabbing everything from the query string and splitting it out on the ampersands (&). You'd need to know exactly what order to put the parameters in, though, since it doesn't use the normal $_GET functionality to assign it to an array.

0 comments voice your opinion now!
shorter url get get_short_url shorter url get get_short_url


blog comments powered by Disqus

Similar Posts

AskAboutPHP.com: Codeigniter: Mixing segment-based URL with querystrings

Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request

David Sklar\'s Blog: Parsing Reasonably-sized HTTP Responses

Tim Bromhead's Blog: Super friendly URLs - handling spaces with URL Rewrites and PHP

The bla.st Blog: Process your URLs in PHP with Apache mod_rewrite and wildcard DNS


Community Events





Don't see your event here?
Let us know!


laravel community version api interview language framework series tool conference opinion symfony unittest voicesoftheelephpant composer introduction podcast list release configure

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework