導航:首頁 > 編程語言 > 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相關的資料

熱點內容
程序員放棄後會怎樣 瀏覽:186
河北模具編程 瀏覽:189
adb查找命令 瀏覽:323
安卓手機視頻文件夾怎麼打開 瀏覽:313
平板加密手機後怎麼關閉 瀏覽:572
流媒體伺服器應該注意什麼 瀏覽:538
d8命令編譯 瀏覽:968
壓縮包解壓需要多少空間 瀏覽:148
如何查找app屬性 瀏覽:390
android人臉識別技術 瀏覽:323
pc104編程 瀏覽:336
二維碼反編譯破解推廣 瀏覽:684
修改伺服器的mac地址 瀏覽:529
好玩的編程軟體 瀏覽:901
編程語言創始人有錢嗎 瀏覽:808
短視頻app怎麼獲客 瀏覽:16
查看雲伺服器的應用 瀏覽:438
javadump工具 瀏覽:566
程序員16g 瀏覽:448
程序員沒有辦法成為top怎麼辦 瀏覽:221