导航:首页 > 编程语言 > 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相关的资料

热点内容
数据库查询系统源码 浏览:614
php5314 浏览:354
完美国际安装到哪个文件夹 浏览:666
什么app可以扫一扫做题 浏览:537
程序员编码论坛 浏览:923
淘点是什么app 浏览:658
中国高等植物pdf 浏览:453
51单片机时间 浏览:181
后台如何获取服务器ip 浏览:265
单片机流水灯程序c语言 浏览:232
程序员第二职业挣钱 浏览:237
运行里怎么输入服务器路径 浏览:840
pythonstepwise 浏览:509
刘一男词汇速记指南pdf 浏览:62
php认证级别 浏览:366
方舟编译啥时候推送 浏览:1010
php手机验证码生成 浏览:675
哲学思维pdf 浏览:14
凌达压缩机有限公司招聘 浏览:534
weblogic命令部署 浏览:36