0
我在服務器行爲 - >用戶驗證 - >登錄用戶在Dreamweaver中爲我的Login.php頁面(見下文),我不能像我一樣得到消息:「登錄表單」必須至少有一個獲取用戶名或密碼值的表單元素。它說我應該添加這個元素,但是...我已經在我的代碼中了...?無法在Dreamweaver中驗證用戶的登錄頁面
<?php require_once('Connections/c1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_c1, $c1);
$query_Login = "SELECT * FROM users";
$Login = mysql_query($query_Login, $c1) or die(mysql_error());
$row_Login = mysql_fetch_assoc($Login);
$totalRows_Login = mysql_num_rows($Login);mysql_select_db($database_c1, $c1);
$query_Login = "SELECT * FROM users";
$Login = mysql_query($query_Login, $c1) or die(mysql_error());
$row_Login = mysql_fetch_assoc($Login);
$totalRows_Login = mysql_num_rows($Login);
$query_Login = "SELECT * FROM users";
$Login = mysql_query($query_Login, $c1) or die(mysql_error());
$row_Login = mysql_fetch_assoc($Login);
$totalRows_Login = mysql_num_rows($Login);
?>
<!doctype html>
<html>
<head>
<link href="x-Layout.css" rel="stylesheet" type="text/css" />
<link href="x-Menu.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<title>Dokument bez tytułu</title>
</head>
<body>
<div id="Holder">
<div id="Header"></div>
<div id="NavBar">
<nav>
<ul>
<li><a href="#">Login</li>
<li><a href="#">Register</li>
<li><a href="#">Forgot Password</li>
</ul>
</nav>
</div>
<div id="Content">
<div id="PageHeading">
<h1>Technical University of Lodz</h1>
</div>
<div id="ContentLeft">
<h2>Please, log in</h2>
<h6> </h6>
</div>
<div id="ContentRight">
<form id="LoginForm" name="LoginForm" method="POST" action="">
<table width="400" border="0">
<tbody>
<tr>
<td><h6>
<label for="textarea">Username:</label>
<br>
<br>
<textarea name="UserName" class="StyleTxtField" id="UserName"></textarea>
</h6></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><h6>
<label for="textarea">Password:<br>
<br>
</label>
<textarea name="Password" class="StyleTxtField" id="Password"></textarea>
</h6></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="submit" id="LoginButton" value="Login"></td>
</tr>
<tr>
<td> </td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div id="Footer"></div>
</div>
</body>
</html>
<?php
mysql_free_result($Login);
?>
1。此外,出於好奇,有沒有你不使用的形式爲「行動=」的一部分,做這一切內嵌理由嗎? 2.從PHP 5開始不推薦使用mysql_free_result(),這讓我不知道您正在使用哪種PHP版本。如果你使用的是PHP7,你應該選擇一個替代方案,比如本頁頂部所述的方法之一:http://php.net/manual/en/function.mysql-free-result.php – GreekQuestionMark