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

熱點內容
bytedance這個文件夾是什麼意思呢 瀏覽:585
演算法站的客體 瀏覽:73
src文件夾c語言怎麼運行 瀏覽:19
怎麼把已安裝的app放到桌面 瀏覽:942
如何查看蘋果手機app是否取消訂閱 瀏覽:769
u盤加密之後手機可以打開嗎 瀏覽:42
單片機串口發射怎麼回事 瀏覽:474
程序員假裝自己很忙 瀏覽:798
程序員能力關鍵詞 瀏覽:617
plc編程高級視頻教程 瀏覽:614
java遞歸求n 瀏覽:88
python絕對路徑導入 瀏覽:131
nex5g加密 瀏覽:979
18的空島伺服器地址 瀏覽:90
程序員要學什麼硬體 瀏覽:668
股票漲跌源碼怎麼看 瀏覽:580
加密軟體做法 瀏覽:59
美國程序員有多少中國人 瀏覽:741
人民日報app里怎麼看新聞早班車 瀏覽:589
忘了app怎麼辦 瀏覽:533