Re: Splitting up long URLs
| From: | tedd | Date: | Mon, 07 Jul 2008 16:54:47 +0000 |
| Subject: | Re: Splitting up long URLs | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276379@lists.php.net to get a copy of this message | ||
At 11:57 AM -0400 7/7/08, Daniel Brown wrote:
Very nice. However, there isn't a way to change what the user see's in the browser's url box, is there? For example, can you send a user to http://example.com/a.php, but they see http://example.com/b.php in their browser? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.comYou could display the URL's the way Google handles them:<?php function shortenURL($longURL) {preg_match('/\/?[a-z0-9\.\-]+\//Ui',$longURL,$matches); $shortURL = str_replace('/','',$matches[0]); return $shortURL;} $longURL = "http://some-SPAM-URL-011.example.com/v14gra/p3n15_pump.php?affil=43ERG3245wert002934&boo=yaa!"; echo "<a href=\"".$longURL."\">".shortenURL($longURL)."</a><br />\n"; ?>