Try this javascript for full page script
Used zpage function too

Create a new file "autoshorten.js" or anything
Add this in that

PHP Code: 
<!-- Soft2050 -- Auto Link Shortner through javascript
var alfoundlLinks document.links;
for (var 
i=0i<alfoundlLinks.lengthi++) {

    if (
chkcon(shortemalfoundlLinks[i].href)) {
            
alfoundlLinks[i].href varurl alfoundlLinks[i].href;
    } 
    
}

function 
chkcon(d_listdomain) {
    for(var 
0d_list.lengthi++) {
        if(
domain.toLowerCase().indexOf(d_list[i])>-1){
            return 
true;
        }
    }
    return 
false;

Then in your html page, add this according to your requirements:
PHP Code: 
<script language="javascript" type="text/javascript">
var 
varurl "http://localhost/index.php?link=";
var 
shortem = ['mediafire.com','lulzimg.com''msn.com''megaupload.com''rapidshare.com''yoursite.com', ];
</script> 
Edit the var according to your setup

Finally, add this at the end of the document (adding at top won;t work)
PHP Code: 
<script src="autoshorten.js" type="text/javascript"></script> 
(Link to autoshorten.js)

This should work for lifetalk's code or any other script which can shorten links through $_GET
soft2050 Reviewed by soft2050 on . Needed Simple Link shortenin script .. Hi.. Guys.. I m in need of link shortening script..for the personal use..means i dont want to open a get to paid link shorten .. What i want to be in script : Basically i want a script that can able to show a particular page before the destination link.. Ex If i ve shorten the www.google.com .. So when user click on this shorten link.. There is page with ads on it (this ads put by me of various ad network) for 5 seconds.. Rating: 5