<legend id='yEwCS'><style id='yEwCS'><dir id='yEwCS'><q id='yEwCS'></q></dir></style></legend>

    <i id='yEwCS'><tr id='yEwCS'><dt id='yEwCS'><q id='yEwCS'><span id='yEwCS'><b id='yEwCS'><form id='yEwCS'><ins id='yEwCS'></ins><ul id='yEwCS'></ul><sub id='yEwCS'></sub></form><legend id='yEwCS'></legend><bdo id='yEwCS'><pre id='yEwCS'><center id='yEwCS'></center></pre></bdo></b><th id='yEwCS'></th></span></q></dt></tr></i><div id='yEwCS'><tfoot id='yEwCS'></tfoot><dl id='yEwCS'><fieldset id='yEwCS'></fieldset></dl></div>
    • <bdo id='yEwCS'></bdo><ul id='yEwCS'></ul>
  1. <tfoot id='yEwCS'></tfoot>

    1. <small id='yEwCS'></small><noframes id='yEwCS'>

    2. XML 解析错误:找不到根元素位置

      时间:2023-10-03
        <i id='T8PcM'><tr id='T8PcM'><dt id='T8PcM'><q id='T8PcM'><span id='T8PcM'><b id='T8PcM'><form id='T8PcM'><ins id='T8PcM'></ins><ul id='T8PcM'></ul><sub id='T8PcM'></sub></form><legend id='T8PcM'></legend><bdo id='T8PcM'><pre id='T8PcM'><center id='T8PcM'></center></pre></bdo></b><th id='T8PcM'></th></span></q></dt></tr></i><div id='T8PcM'><tfoot id='T8PcM'></tfoot><dl id='T8PcM'><fieldset id='T8PcM'></fieldset></dl></div>

        <small id='T8PcM'></small><noframes id='T8PcM'>

          <tbody id='T8PcM'></tbody>

        • <bdo id='T8PcM'></bdo><ul id='T8PcM'></ul>
        • <legend id='T8PcM'><style id='T8PcM'><dir id='T8PcM'><q id='T8PcM'></q></dir></style></legend>

              1. <tfoot id='T8PcM'></tfoot>
                本文介绍了XML 解析错误:找不到根元素位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                所以我正在制作一个简单的登录/注册网络应用程序,但我不断收到以下错误:

                So I'm making a simple login/registration web application but I keep getting the following error:

                XML Parsing Error: no root element found Location: file:///C:/xampp/htdocs/EdgarSerna95_Lab/login.html Line Number 37, Column 3:   
                

                XML Parsing Error: no root element found Location: file:///C:/xampp/htdocs/EdgarSerna95_Lab/php/login.phpLine Number 37, Column 3:
                

                这是我的 login.php

                here is my login.php

                <?php
                header('Content-type: application/json');
                
                $servername = "localhost";
                $username = "root";
                $password = "";
                $dbname = "jammer";
                
                // Create connection
                $conn = new mysqli($servername, $username, $password, $dbname);
                // Check connection
                if ($conn->connect_error) {
                    header('HTTP/1.1 500 Bad connection to Database');
                    die("The server is down, we couldn't establish the DB connection");
                }
                else {
                    $conn ->set_charset('utf8_general_ci');
                    $userName = $_POST['username'];
                    $userPassword = $_POST['userPassword'];
                
                    $sql = "SELECT username, firstName, lastName FROM users WHERE username = '$userName' AND password = '$userPassword'";
                    $result = $conn->query($sql);
                
                    if ($result->num_rows > 0) {
                        while($row = $result->fetch_assoc()) {
                            $response = array('firstName' => $row['firstNameName'], 'lastName' => $row['lastName']);
                        }
                        echo json_encode($response);
                    }
                    else {
                        header('HTTP/1.1 406 User not found');
                        die("Wrong credentials provided!");
                    }
                }
                $conn->close();
                ?>
                

                我已经对 xml 解析错误进行了一些研究,但我仍然无法使我的项目正常工作,我尝试过使用 Google Chrome 和 Firefox

                I've done some research about xml parsing errors but I still cant manage to make my project work, ive tried with Google Chrome and Firefox

                推荐答案

                啊哈!今天得到这个的原因会让我看起来很傻,但可能有一天会帮助某人.

                AHA! Got this today for a reason which will make me look pretty silly but which might one day help someone.

                在我的机器上设置了一个 Apache 服务器,使用 PHP 等等......我收到这个错误......然后意识到原因:我点击了有问题的 HTML 文件(即包含 Javascript/JQuery),所以浏览器地址栏显示file:///D:/apps/Apache24/htdocs/experiments/forms/index.html".

                Having set up an Apache server on my machine, with PHP and so on... I got this error... and then realised why: I had clicked on the HTML file in question (i.e. the one containing the Javascript/JQuery), so the address bar in the browser showed "file:///D:/apps/Apache24/htdocs/experiments/forms/index.html".

                要实际使用 Apache 服务器(假设它正在运行等),您需要做的是 "http://localhost/experiments/forms/index.html" 在浏览器的地址栏中.

                What you have to do to actually use the Apache server (assuming it's running, etc.) is go "http://localhost/experiments/forms/index.html" in the browser's address bar.

                在缓解方面,我一直使用index.php"文件,只是更改为index.html"文件.有点问题,因为对于前者,您必须使用本地主机正确"访问它.

                In mitigation I have up to now been using an "index.php" file and just changed to an "index.html" file. Bit of a gotcha, since with the former you are obliged to access it "properly" using localhost.

                这篇关于XML 解析错误:找不到根元素位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:设置多语言 wordpress 下一篇:有哪些方法可以找到 Web 应用程序中的瓶颈?

                相关文章

                最新文章

              2. <i id='UlDvz'><tr id='UlDvz'><dt id='UlDvz'><q id='UlDvz'><span id='UlDvz'><b id='UlDvz'><form id='UlDvz'><ins id='UlDvz'></ins><ul id='UlDvz'></ul><sub id='UlDvz'></sub></form><legend id='UlDvz'></legend><bdo id='UlDvz'><pre id='UlDvz'><center id='UlDvz'></center></pre></bdo></b><th id='UlDvz'></th></span></q></dt></tr></i><div id='UlDvz'><tfoot id='UlDvz'></tfoot><dl id='UlDvz'><fieldset id='UlDvz'></fieldset></dl></div>

                1. <small id='UlDvz'></small><noframes id='UlDvz'>

                    <legend id='UlDvz'><style id='UlDvz'><dir id='UlDvz'><q id='UlDvz'></q></dir></style></legend>
                  1. <tfoot id='UlDvz'></tfoot>
                      <bdo id='UlDvz'></bdo><ul id='UlDvz'></ul>