Currently viewing the tag: "class"

PHP Url Shortener
This class a ready to use class, that aim to use v.gd & is.gd URL shortening API, the class is very self explanatory & easy to use.
I wrote everything so you can only upload the files to your server and you will have a URL shortening page ready to be used, all you have to do is change some of the design, which is optional.

The class is based on the API class written by v.gd developers, I added Human readable errors and made it optional to switch between the shortener services (v.gd or is.gd)

Features

1- Already stablished URL shortener (You only use an API)
2- Shorten your URL on the fly
3- Ready to use class with templates
4- Uses our cross-platform Copy to clipboard zClipDeBugged
5- Pretty Design :D

Usage

/* classToLoad */
 require_once( 'sources/vgdClass.php' );
 $libsClass = new vgdMainClass();
 require_once( 'tpls/templates.php' );
 $libsTemplates = new vgdTemplates();
 
$result  = $libsClass->vgdShorten($_POST['urltoshorten'], $_POST['provider'], $_POST['allias'] );
      #shortened?
       if ($result["response"]){
       $output .= $libsTemplates->showResults($result["response"]);
       }
       # Do we have errors?
       $output .= $libsTemplates->showErrors($result["errorCode"], $errorMessage);

Demos

DEMO | PHP URL Shortening Class by AmgedOsman.com (v.gd & is.gd)

Download

(AO)_PHP_URL_shortener

Tagged with: