日期:2014-05-16 浏览次数:20692 次
<?php $conn=mysql_connect('localhost','root','root') or die("connect error"); mysql_select_db('yi',$conn) or die ("db connect error"); $username="xujinna"; $url="http://172.22.172.27:8085/lxr"; $sql="select * from user where username='$username'"; $query=mysql_query($sql); $row=mysql_num_rows($query); if($row>0){ echo "Welcome to visit Code Search!"; header("location:".$url); } else{ echo "<h1><b>Sorry,You don't hava permission to visit.</b></h1>"; } ?>