我在这里需要帮助

时间:2019-12-23 09:02:38

标签: php html mysql database

process.php

<?php 

$host="localhost";
$user="root";
$password="";
$db="test";

mysql_connect($host,$user,$password,$db);

if(isset($_POST['username'])){

    $uname=$_POST['username'];
    $password=$_POST['password'];

    $sql="SELECT * FROM register WHERE user='".$uname."'AND Pass='".$password."' limit 1";

    $result=mysql_query($sql);

    if(mysql_num_rows($result)==1){
        echo " You Have Successfully Logged in";
        exit();
    }
    else{
        echo " You Have Entered Incorrect Password";
        exit();
    }

}
?>

login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="login.css">
    <link href="https://fonts.googleapis.com/css?family=Righteous&display=swap" rel="stylesheet">
    <script src="https://kit.fontawesome.com/a076d05399.js"></script>
    <title>DumyGo | Login</title>
</head>
<body>
    <div id="particles-js"></div>
    <div class="container">
            <h1>Sign In</h1>
            <form method="POST" action="process.php">
            <div>
                <label for="username"></label>
               <i class="fas fa-user"></i> <input type="text" id="username" name="username" placeholder="username" required />
            </div>
            <div>
                <label for="password"></label>
                <i class="fas fa-lock"></i>  <input type="password" id="password" name="password" placeholder="password" required />
                <h5>Forgot password? <a href="#">Click here</a></h5>
            </div>
            <div>
                <input type="submit" value="submit" class="btn" />
                <h5>Don't have an account? &nbsp;<a href="register.html">Register</a></h5>
            </div>
        </form>
    </div>
    <script src="particles/particles.min.js"></script>
    <script src="particles/app.js"></script>

</body>
</html>

错误:https://imgur.com/a/3ucurQB,如果有人可以帮助我?

我试图在2天之内解决此错误,但是什么也没有。...

我在本地主机上有数据库。

我使用XAMPP。

我还有两个.html文件和.php。

我不知道该怎么办,感谢您的帮助。

0 个答案:

没有答案