亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

沒有這樣的文件或目錄:我該如何解決這個問題?

沒有這樣的文件或目錄:我該如何解決這個問題?

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 關注
  • 127 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號