Jump to content

Recommended Posts

Really haven't done this ever before. You might try search words like "php shorten url" in google to get some tutorials/scripts. Also an idea popped up my mind to make a script on your site to create and store short urls in db. Create some identefier to the script that would indicate its shortened url and when user enters this particular url, you would fetch from db the original url and redirect the user. I dunno how bad or good this would be though. Maybe there is someone else who can give you more useful advice.

Link to comment
https://forums.phpfreaks.com/topic/240501-short-encoding/#findComment-1235497
Share on other sites

sure, thanks

 

What i have ended up doing is a 6 key random generator. And then queried a DB to check if it already exists. The chances of a duplicate are:

 

51 520 374 361 to one so i don't really have to worry about loading time

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/240501-short-encoding/#findComment-1235735
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.