Configuration file <?php/* URL Set * * * Define (site, "http://xxx.com"),//domain name after not add//*api set/define (Api_key, "");//api, application address: http:// qita.in/reg.php/* Advanced Settings/define (Open_ad, "0");//jump page advertising switch, 1 for open, 0 for off. Define (AD, "I am the ad");//advertising content, double quotes must contain only single quotes define (time, "3");//Jump Latency?> main code <?php require_once (' Config.inc.php '); if (api_key== "") {echo "please modify the config.inc.php api_key parameter, <a href=http://qita.in/reg.php target=_blank> Click on the registration application api< /a> "; } if (count ($_get[' URL ')) >0 {//$url = "http://1dnet.net/index.php?api=1&return_url_text=1&longUrl=". $_ get[' url ']; $url = "http://qita.in/app.php?api=". Api_key. " &type=noad&url= ". $_get[' url ']; $ch = Curl_init (); $timeout = 5; curl_setopt ($ch, Curlopt_url , $url); curl_setopt ($ch, Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_connecttimeout, $timeout); //need to add the following two lines to the Web page that requires user detection //curl_setopt ($ch, Curlopt_httpauth, Curlauth_any); //curl_setopt ($ch, Curlopt_userpwd, Us_name. ":". US_PWD); $contents = curl_exec ($ch); eregi (' http://qita.in/(. *) ', $contents, $new); Curl_close ($ch); if (strlen ($contents) <8) {$shorturl = "Please enter the correct short URL";} $shorturl =site. " /$new [1] "; echo "<a target=_blank href=http://$new [1]~s>[statistics]</a>"; Echo ' <input value= '. $contents. ' " > '; }?> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">