仿微博php生成短网址,仿微博php
程序员文章站
2022-05-27 10:43:43
...
仿微博php生成短网址,仿微博php
html code
DOCTYPE html>
html lang="en">
head>
meta charset="utf-8" />
title>urlShorttitle>
head>
body>
form action="urlShort.php" method="post">
input type="text" size="16" name="url" value="输入网址" onfocus="if(this.value=='输入网址'){this.value='';}" onblur="if(this.value==''){this.value='输入网址'};">
input type="submit" value=" 生成 " />
form> a href="http://hovertree.com">何问起a>
body>
html>
php code
php header("Content-Type:text/html;charset=UTF-8"); function base62($x){ $show = ''; while($x>0){ $s = $x % 62; if ($s > 35){ $s = chr($s + 61); }else if ($s > 5 && $S){