This script is simple, but works. It creates short url's based on your own domain name. The create script is protected by a simple password and will return plain text or JSON. Included is also a small bit of code for a bookmarklet (see instructions below).
- Run the setup.sql file in your MySQL database to setup the appropriate tables
- Modify the "config.sample.php" file to match your database, short url hostname, and password (used to protect the creation script)
- Rename "config.sample.php" to "config.php"
** Don't forget the .htaccess file! **
- url - (required) - the long url to be shortened
- password - (required) - the password you created in the config file
- callback - (BOOL, optional) - returns the JSON in a callback function. Helpful for the bookmarklet
- text - (BOOL, optional) - for a plain text output
(defaults to JSON output)
- Replace "MYDOMAIN.ME" and "YOURPASSWORD" in the bookmarklet script file
Whenever someone follows your link, a view is recorded with the user's IP and User Agent info. This info is not presently used by the view/stats script, but it may be in the future.
view.php will show you all of your current links, sorted by total views (descending)