我有这个小代码,实际上是一个登录脚本,它检查寄存器是否打开,并在登录按钮后显示:
<?php
include("../inc/db.php");
if(isset($_POST['user']) && isset($_POST['pass']))
{
$password = $_POST['pass'];
$username = $_POST['user'];
$sql = "SELECT * FROM `users` WHERE `user` = '".$username."' AND `password` = '".$password."'";
$rez = $pdo->query($sql);
if($rez->fetchColumn() > 0)
{
...
}
else {echo '<p align="center">...</p>';}
}
else { echo '<p align="center">...</p>'; }
}
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="login">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="user" type="text" id="user"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="pass" type="password" id="pass"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
<?php $sql = "SELECT setare FROM setari WHERE nume_setare = 'OPEN_REG'";
$openreg = $pdo->query($sql)->fetch();
if($openreg['setare'] == 1)
{
?>
<tr>
<td> </td>
<td> </td>
<td><a href="register">Inregistrare</a></td>
</tr><?php } ?>
</table>
</td>
</form>
</tr>
</table>
我的问题是这一行:
include(“ ../ inc / db.php”); 警告:include(E:/wamp/www//inc/db.php):无法打开流:第3行的E:\ wamp \ www \ proiect1-test \ scripts \ login.php中没有此类文件或目录:include():无法在E:\ wamp \ www \ proiect1-test \ scripts \ login.php中打开'../inc/db.php'以包含(include_path ='.; C:\ php \ pear')在第3行
而且我不知道我哪里错了。路径是正确的,如果我按了登录按钮,它就起作用了。如果我按了不正确的用户名和密码组合按了登录按钮,警告就会消失。但是,当我第一次打开它时,它不包括在内。该登录文件包含在站点的索引中。
蓝山帝景
莫回无