Ir ao conteúdo

Nova versão do LURL (Tiny-URL).

Boa noite,

Na primeira versão do LURL (Tiny-URL), o usuário João, sugeriu que em vez de eu gerar um identificador aleatório, que poderia causar problemas quando o banco de dados se tornasse muito grande, eu poderia utilizar o campo ID, pois o mesmo é Auto Increment, e por isso ele se auto incrementa, não permitindo que existam dois campos com o mesmo identificador.

Já pensava em acatar a idéia do João a bastante tempo mas sempre estava com preguiça, até que alguns dias atrás uma amiga pediu ajuda para fazer um script para conversão de números entre bases. Após ajudar a mesma, ficou fácil. Só passar o código para PHP, modificar algumas funções antigas e pronto.

Foi necessário criar dois novos métodos importantes:
[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]

As demais modificações você pode ver aqui:
LURL (Tiny-URL) com Identificador apartir do ID em PHP 4

Assim que for possível vou fazer as alterações na versão para PHP5 onde é utilizado classes.
Matheus Bratfisch

PS: Vou criar uma página para o LURL na sessão Code em breve.

LURL (Tiny-URL) com gráfico e estatísticas para PHP4
LURL (Tiny-URL) com gráfico e estatísticas para PHP5

Publicado emAprendendoCodeMySQLphp

7.908 Comentários

  1. ma ma

    Если вы планируете оформление визы в Таиланд, обратите внимание на сервис quick-visa.cc. Это профессиональное визовое агентство, которое поможет вам быстро получить визу. Особенно удобно, что есть русскоязычная версия сайта — quick-visa.cc/ru/. Я сам недавно пользовался их услугами и остался очень доволен. Они подробно объясняют все этапы. Если вы ищете надёжное решение по теме quick-visa.cc/ru/ https://www.quick-visa.cc, рекомендую начать с их сайта. Всё расписано максимально понятно.

  2. ma ma

    Если вы планируете переезд в Таиланд, обратите внимание на сервис quick-visa.cc. Это профессиональное визовое агентство, которое поможет вам оформить все документы для визы. Особенно удобно, что есть русскоязычная версия сайта — quick-visa.cc/ru/. Мой друг уже обращался к ним и остался в полном восторге. Всё было сделано оперативно и без лишних вопросов. Если вы ищете надёжное решение по теме quick-visa.cc, рекомендую начать с их сайта. Всё расписано максимально понятно.

  3. Been using Tenobet since about four months now, mostly spins plus some football action come Saturday. To be fair, I first joined after a lad from my local mentioned it, so my expectations weren’t massive.\n\nGame selection is decent — I reckon about 2,000 games if you count everything. All the big studios are in: Pragmatic Play, Play’n GO, Play’n GO, Big Time Gaming. I mostly stick to Sweet Bonanza and Book of Dead, although the BTG titles is where I lose the most. Live side is Evolution, which is basically the gold standard — actual dealers, blackjack tables at all hours, and Crazy Time if you fancy something daft.\n\nThe sign-up offer on Tenobet goes to ?125 matched and a chunk of free spins, wagering sits at 30x , so about standard. No free-money freebie unless I missed it, you need ?10 to kick it off. For the up-to-date codes they’re listed on tenobet casino login before you deposit. The one thing that annoyed me: bonus expiry is tight and I lost half of mine to being busy.\n\nCashouts have been fine. Skrill came back in under 24 hours the two times I tried, Visa took 2-3 days, which is normal for UK banking. They do Neteller, Mastercard and crypto, though I haven’t bothered with Bitcoin. KYC was a bit of a faff — driving licence and a bank statement, cleared overnight.\n\nNo app on the Play Store, it’s a browser version and loads quick enough on my phone — I use it more than desktop now. Live chat at Tenobet took about five minutes both times, human, not a bot loop. Licensed and regulated for UK players, which is the first thing I check these days.

  4. I’ve been betting with Tenobet since maybe six months now, mostly weekends, mostly spins plus some accumulator betting come Saturday. Not gonna lie, I only signed up because a lad from my local mentioned it, so my expectations weren’t massive.\n\nGame selection is better than I expected — I reckon about 3,000 slots if you count everything. The usual suspects are there: Pragmatic Play, Play’n GO, Microgaming, Betsoft. I live on Gates of Olympus and Sweet Bonanza, though the Megaways stuff gets a look in. The live dealer rooms are Evolution, so no complaints there — real croupiers, roulette round the clock, and Crazy Time if you fancy something daft.\n\nThe welcome thing at Tenobet is up to ?125 matched plus a batch of bonus spins, and the wagering was 30x , so about standard. There’s no free-money thing that I found, you need ?10 or ?20 to kick it off. If you want the current terms they’re listed on tenobet reviews since these change. The one thing that annoyed me: the spins expire in 7 days and I wasted a load.\n\nWithdrawals have been fine. E-wallet took about a day for me, debit card was three working days, which is just how cards are. Tenobet also takes Bitcoin and the usual e-wallets, but I’ve never used crypto on a bookie. The ID check was painless enough — passport and a utility bill, cleared overnight.\n\nNo app on the Play Store, but the mobile site and loads quick enough on my phone — I’ve placed bets on it on the train plenty. Support on Tenobet took a few minutes when I asked about a stuck bonus, actual person, decent English. It’s UKGC licensed, which is the first thing I check these days.

  5. Been using Tenobet since maybe four months now, mainly slots during the week and the odd accumulator action on Saturdays. To be fair, I first joined after a lad from my local wouldn’t shut up about it, so my expectations weren’t massive.\n\nGame selection is better than I expected — somewhere around 3,000 slots across all the categories. The usual suspects are there: Pragmatic, Play’n GO, Play’n GO, Big Time Gaming. I mostly stick to Gates of Olympus and Sweet Bonanza, though the BTG titles eats my balance faster. Live side is Evolution, which is basically the gold standard — real croupiers, roulette round the clock, plus Crazy Time and Lightning Roulette.\n\nThe sign-up offer at Tenobet goes to ?125 matched with some free spins, wagering sits at 35x on the bonus — that’s nothing scandalous but read it properly. No free-money freebie as far as I could see, you need ?10 minimum. For the up-to-date codes see tenobet sport rather than trusting my memory. The one thing that annoyed me: the spin credits vanish quick and I lost half of mine to being busy.\n\nPayouts have been fine. Skrill came back in about a day the two times I tried, card took closer to three days, which is normal for UK banking. Tenobet also takes Neteller, Visa and some crypto options, but I’ve never used crypto on a bookie. The ID check was a bit of a faff — driving licence and a bank statement, cleared overnight.\n\nNo app on the Play Store, it’s the mobile site which honestly works — I use it more than desktop now. Support at Tenobet took under ten minutes both times, human, not a bot loop. Licensed and regulated for UK players, which is the first thing I check these days.

  6. I’ve been playing at Tenobet for about four months now, usually spins during the week and the odd accumulator betting on Saturdays. Not gonna lie, I first joined after a lad from my local wouldn’t shut up about it, so I went in fairly sceptical.\n\nThe lobby’s genuinely big — somewhere around 2,500 slots if you count everything. The usual suspects are there: Pragmatic Play, NetEnt, Microgaming, Betsoft. I mostly stick to Gates of Olympus and Sweet Bonanza, although the Megaways stuff is where I lose the most. The live dealer rooms are Evolution, so no complaints there — actual dealers, blackjack tables at all hours, plus Crazy Time and Lightning Roulette.\n\nThe sign-up offer at Tenobet is up to ?125 plus some free spins, the playthrough is 30x — that’s fair enough. No free-money freebie that I found, min deposit was ?10 or ?20 minimum. For the up-to-date codes they’re listed on [url=https://clock-desktop.com/en-gb]tenobet casino online[/url] rather than trusting my memory. My gripe: the spins expire in 7 days and I wasted a load.\n\nWithdrawals are the bit I actually care about. Skrill came back in about a day for me, card took three working days, which is normal for UK banking. You also get Bitcoin and the usual e-wallets, though I haven’t bothered with Bitcoin. The ID check was a bit of a faff — passport and a utility bill, cleared overnight.\n\nThere’s no standalone app that I found, but the mobile site which honestly works — I’ve placed bets on it on the train plenty. Support at Tenobet took a few minutes when I asked about a stuck bonus, actual person, decent English. Licensed and regulated for UK players, which is why I stuck around.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *