<?php
require_once("../global/checkuser2.php");
?>
<!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>添加链接</title>
<link rel="stylesheet" href="addmodify.css" />
<script src="../global/jquery-latest.min.js"></script>
<script src="weblink.js"></script>
<script>
function check(){
var webname=document.getElementById("name").value;
var url=document.getElementById("url").value;
var type=document.getElementById("type").value;
var user=document.getElementById("user").value;
if(webname==""){
alert("网站名称不能为空");
return false;
}
if(url==""){
alert("网站地址不能为空");
return false;
}
if(type==""){
alert("外链类型不能为空");
return false;
}
if(user==""){
alert("发布人不能为空");
return false;
}
}
function showmessage(){
var type=document.getElementById("type");
if(type.options.length<2)
document.getElementById("show").innerHTML="外链类型为空，请先设置外链类型";
}
</script>
</head>

<body onload="showmessage()">
<?php
require_once("../global/connect.php");
?>
<div class="bigdiv">
<table cellspacing="0" cellpadding="0" style="font-size:14px;"><tr><td style="text-align:left;border-left:none;">您的位置：<a href="index.php">网站外链数据</a>/<a href="add.php">添加链接</a></td><td style="text-align:right;border-left:none;"><a href="index.php">返回</a>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>
<div class="list">
<div class="content" id="surldiv">
<ul>
<li>网站地址：<input type="text" id="surl" name="surl" value="" style="width:300px;" /></li>
<li style="text-align:center;height:40px;line-height:40px;"><input type="button" value="提交" class="btn" id="surlbtn"/>&nbsp;&nbsp;<input type="button" value="重置" class="btn" onclick="javascript:document.getElementById('surl').value=''"/></li>
</ul>
</div>
<form action="function.php?mod=add" method="post" onsubmit="return check()">
<div class="content" style="display:none;" id="urldiv">
<ul>
<li>网站名称：<input type="text" id="name" name="name" value="" /></li>
<li>网站地址：<input type="text" id="url" name="url" value="" style="width:290px;" readonly="readonly"/></li>
<li>外链类型：<select id="type" name="type">
<option value="">外链类型</option>
<?php
			  $rss=mysql_query("select * from linktype");
			   if($rss){
			   while($row=mysql_fetch_array($rss)){?>
			   <option value="<?=$row['name']?>"><?=$row['name']?></option>
			 <?php }}?>
</select><span id="show" style="color:red;"></span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PR值：<input type="text" id="pr" name="pr" value="" readonly="readonly"/><span id="prget" style="font-size:12px;line-height:25px;"><img src="../images/loading.gif" alt="请稍后"/>正在提取中,请稍后...</span></li>
<li>百度收录：<input type="text" id="baidu" name="baidu" value="" readonly="readonly"/><span id="baiduget" style="font-size:12px;line-height:25px;"><img src="../images/loading.gif" alt="请稍后"/>正在提取中,请稍后...</span></li>
<li>链接状态：<input type="text" id="linkstate" name="linkstate" value="" readonly="readonly"/><span id="linkstateget" style="font-size:12px;line-height:25px;"><img src="../images/loading.gif" alt="请稍后"/>正在提取中,请稍后...</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;发布人：<select id="user" name="user">
<option value="">发布人</option>
<?php
			  $rs=mysql_query("select * from user");
			   if($rs){
			   while($row=mysql_fetch_array($rs)){?>
			   <option value="<?=$row['name']?>"><?=$row['name']?></option>
			 <?php }}?>
</select></li>
<li style="text-align:center;height:40px;line-height:40px;"><input type="submit" value="提交" class="btn"/>&nbsp;&nbsp;<input type="reset" value="重置" class="btn"/></li>
</ul>
</div>
</form>
</div>
</div>
</body>
</html>
