导航:首页 > 编程语言 > php449

php449

发布时间:2023-06-11 09:15:16

php+SQLserver制作一个简单的登录功能。

<!-- content starts -->
<?php
if(isset($_POST['add']))
{

date_default_timezone_set('Etc/GMT-8');
$txtname=$_POST['username'];
$txpassword=$_POST['userpwd'];
$txtvalue=$_POST['quxnain'];
$sqlstr = "select * from T1_user where name='".$txtname."'and password=".$txpassword.";";
$conn = mysql_connect("192.168.0.3","root","root");//此处替换用户名和密码
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
$result = mysql_query($sqlstr);
$rs=mysql_fetch_array($result);
if($rs)
{

echo "<script>alert('登录成功!')</script>";
if($txtvalue==1)
echo "<meta http-equiv=refresh content='0;url=../face.php'>";
else
echo "<meta http-equiv=refresh content='0;url=welcome.htm'>";
}
else
echo "<script>alert('用户名或密码错误!')</script>";
}

?>
<body>
<div id="Layer1" style="position:absolute; width:100%; height:100%; z-index:-1">
<img src="images/真烦人.gif" height="100%" width="100%"></img>>
</div>

<div style='height=100'></div>
<form name="form1" method="post" enctype="multipart/form-data" action="" onSubmit="return check()">
<div style="background-image:url(images/登录小窗口.jpg);margin-left:150px;margin-top:140px;width:542px;height:220px">
<table width="449" height="139" style="margin-left:50px;margin-top:55px;">
<tr>
<td width="187">用户名: <input name=username type=text class=radio0 size=19></td>
<td width="30" style="width:70px;"></td>

<td width="216"><button name="add" type="submit" style="background-image:url('images/登陆按钮.jpg');width:210px;height:43px"></button></td>
</tr>
<tr></tr>
<tr>
<td>密 码:<input name=userpwd type=password class=radio0 size=20></td>
<td></td>
<td></td>
</tr>
<tr>
<td >权 限:<select name="quxnain" style="width:90px">
<option value="1">用户</option>
<option value="2">管理员</option>

</select></td>
<td></td>
<td><button type="reset" style="background-image:url('images/注册按钮.jpg');width:210px;height:43px" onClick="location='register.php'"></button></td>
</tr>
</table>
</div>
</form>
</body>
</html>

拿走用吧

阅读全文

与php449相关的资料

热点内容
程序员能力关键词 浏览:615
plc编程高级视频教程 浏览:610
java递归求n 浏览:84
python绝对路径导入 浏览:126
nex5g加密 浏览:975
18的空岛服务器地址 浏览:86
程序员要学什么硬件 浏览:666
股票涨跌源码怎么看 浏览:576
加密软件做法 浏览:55
美国程序员有多少中国人 浏览:739
人民日报app里怎么看新闻早班车 浏览:585
忘了app怎么办 浏览:529
如何用云服务器做云平台 浏览:299
非箍筋加密区剪力 浏览:117
利联科技服务器卡怎么办 浏览:384
js和python哪个好 浏览:463
c盘的哪些文件夹没用 浏览:81
文件为什么会超出在线解压限制 浏览:591
python类实例化对象 浏览:797
硬盘dos外部命令 浏览:794