GithubHelp home page GithubHelp logo

xsavitar / url-shortener Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 7.0 240 KB

This is a URL shortener application built using PHP and MySQL database MS.

Home Page: https://tools.wmflabs.org/durl-shortener/shortener.php

License: MIT License

CSS 8.70% JavaScript 6.48% PHP 84.82%
ajax ajax-request css3 html5 javascript mysqli php php56 url-shortener

url-shortener's People

Contributors

gsokol avatar rosalieper avatar therealahall avatar xsavitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

url-shortener's Issues

Setup Travis CI for project

Travis CI should be setup for the repo / project for automated testing to be done before review is carried out on PR and/or the project. Consider a minimum PHP version of 5.6 for the project.

Searching long link in db before shortening

When the long link is gotten from the browser, there should be a check for whether the link already exist in the DB. If its found in the DB, then the application should just returned its corresponding short link else it should then do the hashing and return the short link in the browser.

Creation of links for testing on localhost and tool labs

Looking at the db-connection file in php-scripts folder, you can clearly see that there are 2 configurations for connecting to the DB. There is one for localhost and another for tool labs (deployment env). Also, if you look at the shortener.php in the root directory, you will see that;
$LINK = "tools.wmflabs.org/durl-shortener/shortener.php/" which is only valid on tool labs. But when used on localhost, we need something like this:
$LINK = "localhost:3000/shortener.php" where 3000 is the localhost deployment port. So check files that have link that point to tool labs and create a local host version.

You can decide to make the tool labs link variable like this: $LINK_TL and the localhost variable like this: $LINK_LH.

Site does not open on firefox browser

When using Chrome browser, the url-shortner site opens well but does not when using firefox. It reports erros like:
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

  • This problem can sometimes be caused by disabling or refusing to accept cookies.
    

Create DB config class

Codes for connecting to database is really procedural and needs to be changed to an object oriented paradigm. So a class for this operation should be created and used in the codes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.