Take any long, ugly URL you like and insert it into the form below, then hit the shrink button:



url_id, 10, 32); // echo "

Itsy Bitsy URL: " . $base_url_redirect . "/itsy?bitsy=$itsy_url

"; $shortest_url = $base_url_redirect . '/' . $itsy_url; echo "

Smallest URL: $shortest_url

"; if (!isset($run_once)) { db_query("UPDATE {itybity} SET count=%d, modified=%d WHERE url ='%s'", $found->count+ 1, time(), $bity); } } else { global $user; db_query("INSERT INTO {itybity} (url_id, url, created, modified, uid, public) VALUES('', '%s', '%d', '%d', '%d', '%d')", $bity, time(), time(), $user->uid, $public); $result = db_query("SELECT url_id FROM {itybity} WHERE url='%s'", $bity); if ($url_id = db_fetch_object($result)) { $itsy_url = base_convert($url_id->url_id, 10, 32); // echo "

Itsy Bitsy URL: " . $base_url_redirect . "/itsy?bitsy=$itsy_url

"; $shortest_url = $base_url_redirect . "/$itsy_url"; echo "

Smallest URL: $shortest_url

"; } } } if (!empty($itsy_url_code) && !isset($run_once)) { $url_id = base_convert($itsy_url_code, 32, 10); $result = db_query("SELECT url, hits FROM {itybity} WHERE url_id=%d", $url_id); if ($found = db_fetch_object($result)) { db_query("UPDATE {itybity} SET hits=%d WHERE url_id=%d", $found->hits+1); header('Location: ' . $found->url); } } if (!isset($run_once)) { $run_once = true; } ?>

Source Code