09-27-2009, 04:45 PM
|
#9 (permalink)
|
|
The Addict
Join Date: May 2009
Posts: 287
Thanks: 5
|
I'm not sure if you want this comment on your blog.
This script has a great starting direction. For example, if you wanted to give users the visibility of the long url, and still give the short url service the correct traffic you could do something like this.
PHP Code:
<?php
// Grab the link $url = $_POST['url'];
// Now get the destination. require 'longurl.php'; $send_to = longurl::get('http://tinyurl.com/past9o');
// Now print out the link echo '<a href="' . $url . '">' . $send_to . '</a>';
?>
One major problem is users and search engines would see this and most likely think that the site is trying to send users to the wrong page.
You could however do something similar to whitehouse.gov and display a popup whenever the user wants to visit a short URL.
Better yet, when the user click the short url you could have a default setting that changes the <a>'s visible text to that longer URL. (The href="" could change based on the user preference.) This would give users added security and comfort in where they are headed.
|
|
|
|