Single

【PHP源码】短网址

<?php
error_reporting(0);
$text=$_REQUEST["url"];
if($text==null){
echo "不完整";
exit();
}
$curl=curl_init();
$url="https://sa.sogou.com/gettiny?url=".$text."";
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_TIMEOUT,20);
$ret=curl_exec($curl);
if($ret==null){
echo "失败";
exit();
}
echo $ret;
?>

 

暂无评论

发表评论