为了账号安全,请及时绑定邮箱和手机立即绑定

没有这样的文件或目录:我该如何解决这个问题?

没有这样的文件或目录:我该如何解决这个问题?

PHP
MMMHUHU 2022-10-28 14:51:57
当我试图创建一个登录系统时,我收到了这个错误: Impossibile interrogare il database No such file or directoryPHP过程代码是这样的:<?php    session_start();include('db-conn-dashboard.php');$nomeutente = $_POST['nomeutente'];$password = $_POST['password'];$nomeutente = stripcslashes($nomeutente);$password = stripcslashes($password);$nomeutente = mysql_real_escape_string($nomeutente);$password = mysql_real_escape_string($password);$result = mysql_query("SELECT * FROM profili WHERE nomeutente = '$nomeutente' and password = '$password'")    or die("Impossibile interrogare il database ".mysql_error());$row = mysql_fetch_array($result);if($row['nomeutente'] == $nomeutente && $row['password'] == $password){    $_SESSION['login_user1'] = "autorizzato1";    $_SESSION['autorizzato'] = 1;    header('location: ../pages/home.php');} else {    echo '<script type="text/javascript">alert("Nome utente o password errati. Riprova.")    window.location= "../pages/login.php"</script>';}?>形式是这样的:<form role="form" action="../php/processo-accesso.php" method="POST">                            <fieldset>                                <div class="form-group">                                    <input class="form-control" placeholder="&#xf007;  Nome utente" name="nomeutente" type="text" style="font-family: fontawesome, arial;" onkeyup="this.value = this.value.toUpperCase();" required>                                </div>                                <div class="form-group">                                    <input class="form-control" placeholder="&#xf084;  Password" style="font-family: fontawesome, arial;" name="password" type="password" required>                                </div>                                <input type="submit" name="accedi" class="btn btn-primary" value="Accedi" style="width: 100%;">                            </fieldset>                        </form>
查看完整描述

1 回答

?
倚天杖

TA贡献1828条经验 获得超3个赞

尝试这个


$sql= mysql_query("SELECT * FROM profili WHERE nomeutente = '$nomeutente' and password = '$password'")

    or die("Impossibile interrogare il database ".mysql_error());


$result=mysql_query($sql);


$row=mysql_fetch_array($result);


查看完整回答
反对 回复 2022-10-28
  • 1 回答
  • 0 关注
  • 111 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号