Create & copy shoter URL to clipboard


Today I’m going to share some work I did during the last couple of weeks. These days most of us make use of Tweeter, Buzz, etc … to update our status, pass some information, etc… . So in most cases when we want to share some interesting things found on web sites it’s convenient if we can get a shorter version of the actual URL generated within the site itself, because this can be very easily place among the content we want to share. In the mean time get it copied to the clipboard with a single mouse click. You might wonder why getting into this much of a trouble when there are enough freely available services (bit.ly, tiny.cc,shortURL.com, etc…) to make the required URL shorter. The most important point is that we should always make sure that we make our user’s life easy with one go.

I found this interesting article on JustNI Blog that explained how to generate a shorter version of the true URL locally with the use of PHP and MySQL. His approach has provided a way to make use of the .htaccess file to handle the necessary url redirection.

His approach

instead

Let me introduce my 2 cents to his approach by further extending the functionality to have the generated URL copied to the clipboard:

  • During each page load grab the page URL
  • Generate the corresponding shorter URL version if it doesn’t exists ( short database table).
  • Store that URL on the page(preferably inside a HTML hidden field).
  • Provide a button or image to get the URL copied to the clipboard ( Here it provides a comprehensive cross browser compatible, Flash supported jQuery based implementation of Copy to Clipboard ).
  • Place the URL redirection process related logic inside the index.php file.
  • Once the shorter version of the URL is requested, the logic on the index.php extracts the query string passed for url( ?url=AX37JEGJR335AK4RB ) part and check its corresponding longer/original URL stored inside the system( short database table). If exists then it takes the user to the corresponding page else shows the user a message like “Page not found – 404”.

57 Comments

  1. January 24, 2013 at 4:25 pm

    Everything posted made a bunch of sense. But, what about this?
    suppose you composed a catchier title? I ain’t saying your information is not solid, however what if you added a title to possibly grab a person’s attention?
    I mean Create & copy shoter URL to clipboard tHOUGHTS & iDEAS is kinda vanilla.
    You could peek at Yahoo’s home page and note how they create news titles to get people to click. You might add a video or a pic or two to grab readers interested about everything’ve written.

    Just my opinion, it might bring your posts a little bit more interesting.

  2. February 8, 2013 at 9:36 pm

    Truly when someone doesn’t know then its up to other viewers that they will help, so here it happens.

  3. Misty said,

    February 24, 2013 at 10:41 am

    How do you people combat against all this junk posts.
    … it’s freakin continuous and my site is flooded by the hour. I’ve got this
    cheap plug-in on blogger, but it doesn’t work worth a crap. What do you use to fight against this stuff?

  4. New post said,

    April 17, 2013 at 4:34 pm

    That was unexpectedly useful and it has given me an idea to publish a new article
    on my blog. Also, what hosting company do you use?
    Your website seems extremely smooth and mine is awful to load.
    Thank you so much!

  5. X Rays Tech said,

    June 5, 2013 at 2:01 am

    My brother suggested I might like this web site. He was entirely
    right. This post actually made my day. You cann’t imagine simply how much time I had spent for this information! Thanks!

  6. cpap said,

    June 19, 2013 at 12:40 pm

    At this time I am ready to do my breakfast, later than having my breakfast coming yet again to read further news.

  7. flip diaper said,

    July 1, 2013 at 10:41 am

    Hmm it appears like your website ate my first comment (it
    was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m
    thoroughly enjoying your blog. I as well am an aspiring blog blogger but
    I’m still new to everything. Do you have any tips and hints for inexperienced blog writers? I’d really
    appreciate it.

  8. Osvaldo said,

    July 1, 2013 at 11:57 pm

    Good day! This is my 1st comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading your posts.
    Can you suggest any other blogs/websites/forums that deal with the same subjects?
    Many thanks!

  9. July 2, 2013 at 4:17 am

    I appreciate, result in I found just what I used to be taking a look for.
    You’ve ended my four day long hunt! God Bless you man. Have a nice day. Bye

  10. July 2, 2013 at 11:20 pm

    What’s up Dear, are you actually visiting this web site regularly, if so after that you will absolutely obtain pleasant experience.

  11. food chopper said,

    July 3, 2013 at 12:42 am

    WOW just what I was searching for. Came here by searching for ronco veg o-matic food chopper and slicer

  12. Gladys said,

    July 3, 2013 at 5:52 am

    Hmm it looks like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly
    enjoying your blog. I too am an aspiring blog blogger
    but I’m still new to the whole thing. Do you have any suggestions for rookie blog writers? I’d certainly appreciate it.

  13. July 3, 2013 at 8:43 am

    Hi there! Someone in my Myspace group shared this site with us so I came to look it over.

    I’m definitely enjoying the information. I’m bookmarking and will
    be tweeting this to my followers! Great blog and amazing design and style.

  14. Fausto said,

    July 3, 2013 at 8:44 am

    Thanks for a marvelous posting! I quite enjoyed reading it,
    you’re a great author. I will ensure that I bookmark your blog and will come back very soon. I want to encourage that you continue your great job, have a nice evening!

  15. July 3, 2013 at 1:08 pm

    A person necessarily lend a hand to make seriously articles I’d state. This is the very first time I frequented your web page and up to now? I amazed with the analysis you made to create this particular put up incredible. Excellent task!

  16. archery set said,

    July 3, 2013 at 2:11 pm

    Hello, I log on to your blog on a regular basis.
    Your humoristic style is witty, keep up the good work!

  17. Eddie said,

    July 3, 2013 at 4:22 pm

    I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more
    often. Did you hire out a developer to create your theme?
    Outstanding work!

  18. July 4, 2013 at 12:22 pm

    My partner and I stumbled over here by a different web address and thought I might as well check things out.
    I like what I see so i am just following you. Look forward to looking
    at your web page repeatedly.

  19. Cole said,

    July 4, 2013 at 1:01 pm

    I drop a comment when I appreciate a article on a site or I have something to contribute to the discussion.
    Usually it’s caused by the passion communicated in the article I browsed. And after this article Create & copy shoter URL to clipboard | tHOUGHTS & iDEAS. I was actually moved enough to post a comment😛 I do have 2 questions for you if it’s
    allright. Could it be only me or does it look as if like a few of these responses come across like they are left by brain dead people?
    😛 And, if you are posting at other online social sites,
    I would like to follow everything new you have
    to post. Would you list all of all your shared pages like your Facebook page,
    twitter feed, or linkedin profile?

  20. hand vacuum said,

    July 4, 2013 at 9:22 pm

    Incredible! This blog looks just like my old one! It’s on a completely different topic but it has pretty much the same layout and design. Great choice of colors!

  21. July 5, 2013 at 10:12 pm

    Hey There. I found your blog using msn. This is a really well written article.
    I’ll be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I’ll definitely comeback.

  22. 18v drill said,

    July 6, 2013 at 1:05 pm

    It’s actually very complicated in this full of activity life to listen news on TV, therefore I just use the web for that purpose, and take the newest news.

  23. July 7, 2013 at 4:23 am

    Hi there I am so delighted I found your blog, I really found you by
    mistake, while I was browsing on Askjeeve for
    something else, Anyhow I am here now and would just like to say
    cheers for a incredible post and a all round exciting blog (I also love the theme/design), I don’t have time to look over it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read more, Please do keep up the fantastic job.

  24. July 7, 2013 at 7:54 pm

    Howdy! I know this is kind of off topic but I was wondering if you knew where I could find a captcha
    plugin for my comment form? I’m using the same blog platform as yours and I’m having problems finding one?
    Thanks a lot!

  25. July 8, 2013 at 7:14 am

    Very good article! We are linking to this particularly great content on our website.

    Keep up the great writing.

  26. July 8, 2013 at 7:16 am

    It’s going to be finish of mine day, but before end I am reading this impressive paragraph to improve my know-how.

  27. July 9, 2013 at 12:17 pm

    My partner and I stumbled over here different web address and thought I might as well check things out.
    I like what I see so i am just following you. Look forward to looking into
    your web page again.

  28. July 9, 2013 at 3:28 pm

    I like what you guys are up too. This sort of clever work and exposure!
    Keep up the fantastic works guys I’ve incorporated you guys to my blogroll.

  29. July 9, 2013 at 8:36 pm

    Simply desire to say your article is as astonishing.
    The clearness to your publish is just nice and i could assume you are a professional in this subject.
    Well with your permission allow me to take hold of your feed to keep up to date with
    impending post. Thank you one million and please keep
    up the gratifying work.

  30. Brandy said,

    July 12, 2013 at 7:16 am

    Hola! I’ve been following your site for a long time now and finally got the bravery to go ahead and give you a shout out from Houston Texas! Just wanted to mention keep up the great work!

  31. July 12, 2013 at 10:44 am

    Thanks for sharing your thoughts on hair dryer brush straightener.
    Regards

  32. Gerardo said,

    July 13, 2013 at 1:40 pm

    My spouse and I absolutely love your blog and find almost all of your
    post’s to be what precisely I’m looking for. Does one offer guest
    writers to write content in your case? I wouldn’t mind producing a post or elaborating on a few of the subjects you write in relation to here. Again, awesome weblog!

  33. July 13, 2013 at 6:28 pm

    My spouse and I absolutely love your blog and find almost all of your
    post’s to be what precisely I’m looking for. Does one offer guest writers to write
    content for yourself? I wouldn’t mind producing a post or elaborating on a lot of the subjects you write in relation to here. Again, awesome blog!

  34. Mohammed said,

    July 14, 2013 at 1:48 am

    When someone writes an article he/she maintains the idea of a user in his/her
    mind that how a user can know it. So that’s why this piece of writing is amazing. Thanks!

  35. July 14, 2013 at 3:31 am

    Great post. I was checking constantly this blog and I am
    impressed! Extremely useful info specially the last part 🙂 I care for such information a lot. I was looking for this particular information for a very long time.
    Thank you and best of luck.

  36. July 14, 2013 at 4:47 pm

    Spot on with this write-up, I truly believe this amazing
    site needs a lot more attention. I’ll probably be back again to read more, thanks for the advice!

  37. July 16, 2013 at 12:20 am

    Thank you a bunch for sharing this with all of us you really recognize what you’re speaking about! Bookmarked. Please also consult with my web site =). We will have a link exchange contract between us

  38. July 16, 2013 at 3:24 am

    I think this is one of the most important info for me.
    And i’m glad reading your article. But should remark on some general things, The web site style is wonderful, the articles is really excellent : D. Good job, cheers

  39. July 16, 2013 at 8:16 pm

    Hi there! I know this is kinda off topic but I was wondering which blog platform are you using for this site?
    I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform. I would be great if you could point me in the direction of a good platform.

  40. step machine said,

    July 17, 2013 at 5:41 am

    I need to to thank you for this excellent read!

    ! I certainly enjoyed every bit of it. I have you book marked to check
    out new things you post…

  41. July 17, 2013 at 7:45 am

    Hello, after reading this amazing article i am also glad to share my familiarity here with friends.

  42. July 18, 2013 at 5:14 pm

    I needed to thank you for this very good read!
    ! I definitely enjoyed every little bit of it. I’ve got you book-marked to look at new things you post…

  43. July 19, 2013 at 10:15 am

    Pretty section of content. I just stumbled upon your web site and in accession capital
    to assert that I acquire in fact enjoyed account your blog posts.
    Anyway I’ll be subscribing to your feeds and even I achievement you access consistently rapidly.

  44. July 20, 2013 at 4:23 am

    I usually do not leave a comment, but after looking at through a few of the comments
    on Create & copy shoter URL to clipboard | tHOUGHTS & iDEAS.
    I actually do have 2 questions for you if you do not mind.
    Is it just me or do a few of the comments come across as if they
    are written by brain dead people?😛 And, if you are writing at additional
    online sites, I would like to keep up with you.
    Could you post a list of all of all your shared pages like your linkedin profile, Facebook page or twitter feed?

  45. Stephanie said,

    July 20, 2013 at 5:33 pm

    Great post. I used to be checking constantly this blog and I’m inspired! Extremely helpful information particularly the ultimate part🙂 I care for such information much. I used to be seeking this particular info for a very long time. Thank you and good luck.

  46. July 22, 2013 at 6:54 pm

    Howdy! I realize this is sort of off-topic however I needed to ask.

    Does managing a well-established website like yours require a
    massive amount work? I am completely new to writing
    a blog however I do write in my diary everyday. I’d like to start a blog so I can share my own experience and feelings online. Please let me know if you have any recommendations or tips for brand new aspiring blog owners. Appreciate it!

  47. July 23, 2013 at 5:43 pm

    I’d like to thank you for the efforts you have put in writing this blog. I really hope to check out the same high-grade blog posts from you in the future as well. In truth, your creative writing abilities has motivated me to get my very own blog now😉

  48. July 25, 2013 at 9:01 am

    I pay a visit everyday a few web pages and blogs to read
    articles or reviews, however this web site presents quality based
    writing.

  49. July 25, 2013 at 2:33 pm

    Hi there mates, its fantastic post on the topic of educationand fully defined, keep it up all the time.

  50. July 25, 2013 at 7:44 pm

    My brother suggested I might like this website. He was totally right.
    This post actually made my day. You can not imagine simply how
    much time I had spent for this info! Thanks!

  51. Meredith said,

    July 27, 2013 at 1:16 pm

    It is in point of fact a great and useful piece of info.
    I’m satisfied that you simply shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  52. July 27, 2013 at 2:14 pm

    I truly love your site.. Very nice colors & theme. Did you
    develop this web site yourself? Please reply back as I’m wanting to create my very own website and want to find out where you got this from or what the theme is called. Thanks!

  53. July 28, 2013 at 4:36 pm

    I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a great blog like this one today.

  54. 16 inch bike said,

    July 30, 2013 at 3:56 pm

    What’s up i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought i could also make comment due to this sensible paragraph.

  55. August 2, 2013 at 2:02 pm

    You’re so awesome! I don’t think I’ve read anything like this before. So great to find another person with a few unique thoughts on this issue. Really.. thank you for starting this up. This site is something that is needed on the web, someone with a little originality!

  56. May 23, 2014 at 5:14 pm

    Howdy just wanted to give you a brief heads up and let you know a few of the images aren’t loading correctly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers
    and both show the same results.

  57. Loola said,

    January 8, 2015 at 8:05 am

    What’s up, of course this piece of writing is in fact pleasant
    and I have learned lot of things from it concerning blogging.
    thanks.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: