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

3,856 Comments

  1. Всем привет из Москвы Объездил кучу компаний — везде перекупы То логотип съезжает Короче, нашел нормальную контору — корпоративные подарки с логотипом на заказ Качество на высоте В общем, смотрите сами по ссылке — сувениры с логотипом организации https://korporativnye-podarki-merch-aqr.ru Не ведитесь на дешёвые предложения Перешлите тому у кого бизнес

  2. Самара, всем привет Муж просто потерял себя Родственники не знают что делать Таблетки не помогают Короче, единственное что вытащило из запоя — выведение из запоя на дому качественно Через пару часов человек пришёл в себя В общем, телефон и цены тут — запой выезд на дом https://kapelnicza.vyvod-iz-zapoya-na-domu-samara.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

Leave a Reply

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