I created a very simple php link shortener without need of any database.
Github:
https://github.com/johnny-choo/simplelink
Come support me by giving me a star.Thank you.
I created a very simple php link shortener without need of any database.
Github:
https://github.com/johnny-choo/simplelink
Come support me by giving me a star.Thank you.
For further actions, you may consider blocking this person and/or reporting abuse
Dhimas Kirana -
Muhammad MP -
Honeybadger Staff -
Honeybadger Staff -
Oldest comments (5)
Your URL validation is not very solid: johnnychoo.000webhostapp.com/Foo2/
With e.g. this as input
"); echo file_get_contents("../index.php"); // (https://)
so I can upload every php command that I want.
I would use the strpos check with 0 instead of false (so that we protect us against something like "file://" + a build in URL check from php: FILTER_VALIDATE_URL
If you have more question, please contact me, I am happy if I can help. 🙋
Hi Lars Moelleken,
Really appreciate your comment. I have updated my code following your advises.
Pls check it out and if possible feel free to contribute to this project. This project needs a better UI and some extra features.
Hey, johnny-choo! That's amazing that you've made an open source tool yourself. I'm doing product development mysef. And the first question that pops up in my mind is:
Did you have some product idea in your head before making this one?
Maybe you've been not satisfied with some other url shorteners. I mean, what was the incentive to spend the time on this project?
Thanks.
Hi Siarhei Siniak,
Thanks for commenting.
My initiative for this project is to make sending links easier for everyone.
For example, I use it to rename my link, like my Google drive link is very long and I can shorten it into example.com/file. When I want to send to anyone, I do not need to copy and paste but just type it out.
All project idea didn't come out from nowhere. The idea of creating this project pops up is when I face problem with bit.ly which I can't get short link that I want for many times that I need to keep renaming it and sometimes I am only able to generate random short URL.
This is why I started building my own URL shortener website.
To start this project, I actually search through the internet but I unable to find any open source project which is easy to setup.All needed mysql database and some that not need database uses flat file database like storing it in JSON file which I think is not good when storing large number of URL it will be slow redirecting as it takes time to read the file and find the URL and it is difficult to delete short URL which is not wanted anymore.
My plan is to host this website in free hosting platform like 000webhost or infinity free and all these platforms you can upload file through online file manager. Although they offer mysql database but I am lazy to create a database and do configuration change for other php URL shortener open source project. Therefore, I created my own URL shortener from scratch.
I recommend you to use simplelink too. You can create your own URL shortener in just 2 steps (download and upload the code) and with only 2 files. Lastly, give me a star in GitHub for supporting. Thank you.