复制代码 代码如下:
<?php
$hostname_conn = “localhost”;
$databa_conn = “test”;
$urname_conn = “root”;
$password_conn = “1981427”;
$conn = mysql_connect($hostname_conn, $urname_conn, $password_conn);
?>
复制代码 代码如下:
<?php
//该函数用于将一般字符串转换成sql语句所需要的格式
function getsqlvaluestring($thevalue, $thetype)
{
$thevalue = (!get_magic_quotes_gpc()) ? addslashes($thevalue) : $thevalue;
switch ($thetype) {
ca “text”:
$thevalue = ($thevalue != “”) ? “‘” . $thevalue . “‘” : “null”;
break;
ca “int”:
$thevalue = ($thevalue != “”) ? intval($thevalue) : “null”;
break;
}
return $thevalue;
}
?>
复制代码 代码如下:
<?php
ssion_start();
//如果ssion不存在,则跳转到admin.php
if (!(ist($_ssion[‘mm_urname’]))) {
header(“location: admin.php”);
exit;
}
?>
复制代码 代码如下:
<?php require_once(‘connections/conn.php’); ?>
<?php
// *** validate request to login to this site.
ssion_start();
$loginformaction = $_rver[&蔺相如的故事#8216;php_lf’];
if (ist($accesscheck)) {
$globals[‘dnf红眼;prevurl’] = $accesscheck;
ssion_register(‘prevurl’);
}
if (ist($_post[‘urname’])) {
$loginurname=$_post[‘urname’];
$password=$_post[‘password’];
$mm_fldurauthorization = “”;
$mm_redirectloginsuccess = “adminmain.php”;
$mm_redirectloginfailed = “admin.php”;
$mm_redirecttoreferrer = fal;
mysql_lect_db($databa_conn, $con索引文件n);
$loginrs__query=sprintf(“lect adminname, password from admin where adminname=’%s’ and password=’%s'”,
get_magic_quotes_gpc() ? $loginurname : addslashes($loginurname), get_magic_quotes_gpc() ? $password : addslashes($password));
$loginrs = mysql_query($loginrs__query, $conn) or die(mysql_error());
$loginfoundur = mysql_num_rows($loginrs);
if ($loginfoundur) {
$loginstrgroup = “”;
//declare two ssion variables and assign them
$globals[‘mm_urname’] = $loginurname;
$globals[‘mm_urgroup’] = $loginstrgroup;
//register the ssion variables
ssion_register(“mm_urname”);
ssion_register(“mm_urgroup”);
if (ist($_ssion[‘prevurl’]) && fal) {
$mm_redirectloginsuccess = $_ssion[‘prevurl’];
}
header(“location: ” . $mm_redirectloginsuccess );
}
el {
header(“location: “. $mm_redirectloginfailed );
}
}
?>
<!doctype html public “-//w3c//dtd html 4.01 transitional//en” “/d/file/titlepic/loo.dtd& />
<html>
<head>
<title>untitled document</title>
<meta http-equiv=”content-type” content=”text/html; chart=gb2312″>
<style type=”text/css”><!–
.style1 {font-size: 18px;
font-weight: bold;
}
.style2 {font-size: 14px}
–></style><style type=”text/css” bogus=”1″>.style1 {font-size: 18px;
font-weight: bold;
}
.style2 {font-size: 14px}</style>
</head>
<body>
<p align=”center”><span class=”style1″>留言板 – 管理登陆</span></p>
<p align=”center”><span class=”style2″><a href=”viewposts.php” href=”viewposts.php”>浏览留言</a> | <山东计算机二级a href=”newpost.php” href=”newpost.php”>发表留言</a></span></p>
<form name=”form1″ method=”post” action=”<?php echo $loginformaction; ?>”>
<table width=”239″ border=”0″ align=”center”>
<tr>
<td width=”73″>用户名:</td&酒店评价gt;
<td width=”156″><input name=”urname” type=”text” id=”urname”></td>
</tr>
<tr>
<td>密码:</td>
<td><input name=”password” type=”password” id=”password”></td>
</tr>
<tr>
<td> </td>
<td><input type=”submit” name=”submit” value=”提交”>
<input type=”ret” name=”submit2″ value=”重设”></td>
</tr>
</table>
</form>
<p align=”center”> </p>
</body>
</html>
1
本文发布于:2023-04-06 14:32:46,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/d388948c09dbf7fff43d1f21486aca87.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:php mysql 留言本应用实例第1/2页.doc
本文 PDF 下载地址:php mysql 留言本应用实例第1/2页.pdf
留言与评论(共有 0 条评论) |