【php开源代码栏目提醒】:本文主要为网学会员提供15_2.php,希望对需要15_2.php网友有所帮助,学习一下!
<?php
require_once("adodb5/adodb.inc.php");
//my
sql配置变量,用于ADODB连接MYSQL
$db = array(
"host"=>"localhost",
"name"=>"root",
"pwd"=>"password",
"db"=>"learn"
);
//设置链接MySQL数据的变量
//建立链接对象
$conn = ADONewConnection('
mysql');
//链接数据库
$conn->Connect($db["host"],$db["name"],$db["pwd"],$db["db"]);
//设置字符集
$conn->Execute("SET NAMES gb2312");
//检查用户是否登录
function isLogin(){
global $conn;
if(isset($_COOKIE["username"]) and isset($_COOKIE["password"])){
$rs = $conn->Execute("select id from members where username = '".$_COOKIE["username"]."' and pass
word = '".$_COOKIE["password"]."'");
if($rs->RecordCount()<=0){
echo "<script>
alert('请登录.');
window.location.href='15_6.php';
</script>";
}
}
}
//信息提示函数
function info($content,$url){
print <<<EOT
<br />
<table cellpadding="5" cellspacing="0" align="center" class="tableborder1" style="width:60%; border-top:none;">
<tr>
<th height="20" align=center>提示信息</th>
</tr>
<tr>
<td class="tablebody5" align="center">
<table cellpadding="3" cellspacing="1" align="center" style="width:100%">
<tr>
<td align=left>
<blockquote>
<BR>
{$content}<BR>
<br>
如果页面没有自动跳转,请 <a target="_self" href="{$url}">[ 单击进入网页 ]</a>
<script>
function nav(){
window.location.href = "{$url}";
}
//3秒后跳转页面
setTimeout("nav()", 3000);
</script>
</blockquote>
</td></tr>
</table>
</td>
</tr>
</table>
EOT;
exit();
}
?>