2015-05-27
[php]
配置文件
[php]
<?php
/*网址设置*/
define(SITE,"http://xxx.com");//域名后面不要加/
/*API设置*/
define(API_KEY,"");//API,申请地址:http://qita.in/reg.php
/*高级设置*/
define(OPEN_AD,"0");//跳转页广告开关,1表示开,0表示关.
define(AD,"我是广告");//广告内容,双引号里内容必须只能包含单引号
define(TIME,"3");//跳转等待时间
?>
主要代码
[php]
<?php
require_once('config.inc.php');
if(API_KEY==""){
echo "请修改config.inc.php API_KEY参数,<a href=http://qita.in/reg.php target=_blank>点击注册申请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);
//在需要用户检测的网页里需要增加下面两行
//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="请输入正确的短网址";
}
$shorturl=SITE."/$new[1]";
//echo "<a target=_blank href=http://$new[1]~s>[统计]</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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>7898.org免费短地址</title>
<META NAME="Description" CONTENT="126,网易短地址,短网址,短域名,短网址程序,淘宝短网址,短网址转换,短网址还原,百度短网址">
<META NAME="Keywords" CONTENT="网易短地址,短网址,短域名,短网址程序,淘宝短网址,短网址转换,百度短网址">
<link href="favicon.ico" type="image/ico" rel="shortcut icon">
<style>
a:link {color:#666;}
a:visited {text-decoration: none;color: #333;}
a:hover {text-decoration: none; color: #333;}
a:active {text-decoration: none;color: #CCC;}
body{margin:0px;background:url(bg_body.jpg) repeat-x;height:100%;text-align: center;}
.warp{margin:0 auto;width:620px;}img{border:none;}.c{clear:both;}.l{float:left;}.r{float:right;}ul,li{list-style:none;}
.main{margin:0 auto;width:620px;}
.logo{margin:20px auto;text-align:center;}
.logo a{font-size:50px}
.main p{text-align:center;color:#999;font-size:14px;}
.area{padding:10px;background:#f1f7f8;border:1px solid #cfe0e0;}
.text_are{float:left;width:440px;height:36px;padding:5px 0;border:1px solid #c6c6c6;font-size:16px;background:#ffffe6;}
.text_btn{float:left;margin-top:-1px;width:86px;height:36px;border:1px solid #c6c6c6;background:#f8f8f8;}
.list{float:left;margin-top:-1px;padding:9px;border:1px solid #cfe0e0;background:#FFF;font-size:12px;color:#999;}
.list td{padding:3px 5px;border-bottom:1px solid #e1edef;height:30px;}
.more a{color:#333;text-decoration:none;}
.footer{margin-top:15px;font-size:11px;color:#CCC;text-align:center;}
</style>
</head>
<body>
<div class="warp">
<div class="main">
<div class="logo"><a href="<?php echo SITE.'/index.php';?>" title="免费短地址">免费短地址</a></div>
<p>缩短、分享及监测你的链接
</p>
<div class="content" id="list" >
<div class="area">
<form action="<?php echo SITE;?>/index.php" method="get" id="post_form">
<input name="url" type="text" class="text_are" id="short_url" value="http://"/>
<input type="submit" class="text_btn" value="立即缩短"/>
</form>
<div class="c"></div>
</div>
<div class="list" style="width: 600px;">
<table width="600" border="0" cellpadding="0" cellspacing="0" id="list_url">
<tr>
<td bgcolor="#e4e4e4">短链接</td>
<td bgcolor="#e4e4e4">原始网址</td>
</tr>
<tr>
<td>
<?php
echo '<a href="'.$shorturl.'" target="_blank"><b>'.$shorturl.'</b></a></td>';
echo '<td>'.$_GET['url'].'</td>';
?>
</tr>
</table>
</div>
<div class="signdes">
</div>
</div>
</div>
</div>
<div class="footer">
<!--友情链接-->
</div>
<div style="display:none">
</div>
</body>
</html>
作者:liangxunli
1
CI框架连接数据库配置操作以及多数据库操作
09-05
2
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
05-17
3
C语言关键字及其解释介绍 C语言32个关键字详解
04-05
4
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
04-26
5
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
04-12
6
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
09-05
7
PHP中的(++i)前缀自增 和 (i++)后缀自增
09-05
8
PHP中include和require区别之我见
09-05
常用dos命令及语法
2014-09-27
将视频设置为Android手机开机动画的教程
2014-12-11
php递归返回值的问题
2014-09-05
如何安装PHPstorm并配置方法教程 phpstorm安装后要进行哪些配置
2017-05-03
java中的info是什么意思
2022-03-24
PHP 教程之如何使用BLOB存取图片信息实例
2014-09-05
IcePHP框架中的快速后台中的通用CRUD功能框架
2014-09-05
单片机编程好学吗?单片机初学者怎样看懂代码
2022-03-21
PHP数组函数array
2014-09-05
学ug编程如何快速入门?
2022-03-17
2025指尖捕鱼新版下载v10.2.44.7.0 安卓正版
休闲益智 579.4M
下载指尖捕鱼赢话费版下载v10.2.44.7.0 安卓版
休闲益智 694.3M
下载指尖捕鱼高爆率多人捕鱼游戏下载v10.2.44.7.0 安卓版
休闲益智 466.2M
下载指尖捕鱼吴孟达版下载v10.2.44.7.0 安卓最新版
休闲益智 694.3M
下载飞机大厨2025最新版(airplane chefs)下载v12.0.2 安卓免费版
经营养成 140.3M
下载捕鱼大决战狂暴版官方版下载v122.7.286 安卓高爆版
休闲益智 153.5M
下载捕鱼大决战最新版本下载v122.7.286 安卓正版
休闲益智 153.5M
下载捕鱼大决战深海版游戏下载v122.7.286 安卓版
休闲益智 153.5M
下载拳皇14官方正版下载v2.0.0 安卓正式版
下载
勇者大战魔物娘安卓手游下载v1.10.29 安卓冷狐汉化版
下载
贝比岛最新版下载v2.5.4 安卓官方版
下载
奥特曼格斗进化3高清汉化版(Ultraman Fighting Evolution 3)下载v3.3.2 安卓免费版
下载
王者荣耀全英雄全皮肤版本下载v10.11.7.1 安卓版
下载
漫威超级战争手游下载v3.23.0 安卓手机版
下载
悟饭游戏厅苹果版(我Fun趣味)下载v1.5.6 iPhone版
下载
无畏契约valorant官方版下载v1.0.3 安卓版
下载