Skip to content

URL Shortener using Auto-Increment field.

Good Night,

This is a new version of URL-Shortener that don’t create random IDs to websites, it uses the auto-increment field and replace it to other base.

It was necessary to create two new methods
[code lang=”php”]
function convertDecimalTo($decimal,$newBase,$str,$letters) {
if ($decimal >= $newBase) {
$x = $decimal % $newBase;
$y = $decimal / $newBase;
$str = $letters{$x} . $str;
if ($y < $newBase) { $str = $letters{$y} . $str; } return convertDecimalTo($y,$newBase,$str,$letters); } else { if (strlen($str) == 0) { $str = $letters{$decimal} . $str; } return $str; } } function convertBaseToDecimal($value,$newBase,$letters) { $sum = 0; $len = strlen($value); $end = $len-1; for ($x=$end;$x>=0;$x–) {
$sum = $sum + strpos($letters,$value{$x}) * pow($newBase,($end – $x));
}
return $sum;
}
[/code]

You can download the full new version to PHP4
URL Shortener (LURL) using auto increment field to generate the “TAG”

Hope you enjoy,
Matheus

Chart to your URL Shortener with Statistics. PHP4

Published inAprendendoCodeMySQLphp

634 Comments

  1. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  2. My brother recommended I would possibly like this web site.

    He was once entirely right. This submit actually made my day.

    You cann’t imagine simply how so much time I had spent for this info!

    Thanks!

    Check out my homepage; Casino caribbean

  3. casino winnings taxable in united kingdom, online bingo uk no deposit and online
    slot casino uk, or best free poker sites united states

    my web-site … can i earn money without investment (Zachery)

  4. list of united statesn online casinos, no deposit casinos for usa and omni slots united states, or minimum dollar 5 deposit casino australia

    Feel free to surf to my web page; can you gamble at
    18 at pechanga (Caitlin)

Leave a Reply

Your email address will not be published. Required fields are marked *