verifauthen.php

来自「matlab ystem will automatically delete 」· PHP 代码 · 共 38 行

PHP
38
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<?php 

$cnx = mysql_connect("127.0.0.1","root","") or die ("impossible de se connecter");
$db="isi";
mysql_select_db($db,$cnx)or die ("impossible d'ouvrir la base");
if (isset($_POST["txt1"])&&isset($_POST["txt2"]))
{
$nom=$_POST["txt1"];
$pwd=$_POST["txt2"];
$requete=mysql_query("select * from utilisateur");
while($result=mysql_fetch_row($requete))
{

if($result[0]==$nom && $result[1]==$pwd)
{
$test=true;
break;
}
else
$test=false;
}
if ($test)
header("location: classes.php");
else
header("location: index.php");
}
?>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?