我无法在我的联系表上修复此错误

时间:2019-05-28 16:59:24

标签: javascript php jquery html sql

当我按下“发送给我们”按钮时,出现此错误。也许它没有发送到数据库,因为它不是 错误是:

  

连接失败:ProxySQL错误:用户'root'@'2a02:4780:bad:f00d :: 1a'(使用密码:否)的访问被拒绝

我的TRIES PHP代码是

 <?php
include "db_connect.php";
include "db_config.php";


if(isset($_POST['create'])) {
    $conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
    $name = $_POST['name'];
    $email = $_POST['email'];
    $text = $_POST['subject'];

    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }

    $sql = "INSERT INTO contact (name,email, text)
    VALUES ('$name', '$email', '$text')";

    if ($conn->query($sql) === TRUE) {
        echo "SUCCESSFULLY";
    } else {
        echo "Error: " . $sql . "<br>" . $conn->error;
    }

    $conn->close();
}
?>

我的TRIES HTML代码为:

<form action="contact.php" method="post">
        <br>


                    <h1>CONTACT WITH US</h1>
<br>

                    <label for="Name"><b>Name</b></label><br><br>
                    <input class="form-control" id="name" type="text" name="name" required>
<br><br><br>
                    <label for="email"><b>email</b></label><br><br>
                    <input class="form-control" id="email"  type="text" name="email" required>
<br><br><br>
                    <label for=" SOME TEXT"><b> SOME TEXT</b></label><br><br>
                    <input type="text" name="subject" value="" placeholder="Some text..." " style="height:200px">
<br><br><br>

                    <input class="button" type="submit" id="contact" name="create" value="Sent us"><br><br><br>
</form>
</div>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
<script type="text/javascript">

</script>

0 个答案:

没有答案