第2页中的require_once('page1.php')在第2页中整体显示第1页,就像iframe

我只是想使用当前页面上其他页面的输入来显示用户键入的内容。但是,输入所来自的整个页面却出现在该页面上,就像一个iframe。 我尝试了include并把需求一次放在了首位,但这没用。

这是第2页(student.php)

<html>
<head lang='de'>
    <title>Admin User Verwaltung</title>
    <meta charset='UTF-8'>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
</head>
<body>
    <div class="container-fluid">
        <!-- Header -->
        <div class="row" id="header">
            <div class="col-md-3">
                <img src="logo.png" id="logo">
            </div>

            <div class="col-md-6">
                <h1 id="heading">Benutzeroberfläche User</h1>
            </div>

            <div class="col-md-3">
                <p id="profile">
                <?php  
                    require_once ('log_in.php');
                    echo $_POST['user_name'];
                ?>
                </p>
            </div>

        </div>
    </div>

</body>

那是第1页(log_in.php)

  <form method="POST" action="log_in.php" accept-charset="UTF-8" class="">
                <!-- <input name="_token" type="hidden" value="Ca3dsumBPuWvCa7tJ13oK6khcG6HVhfY1X9bxQhK"> -->
                <div class="form-group">
                    <label>User Name</label>
                    <input class="form-control" tabindex="1" required="true" placeholder="z.B. User001" autofocus="true" name="username" type="text">
                </div>
                <div class="form-group">
                    <label class="d-flex">Passwort
                        <a class="ml-auto" href="https://studentenportal.fhws.de/password-reset">Passwort vergessen?</a>
                    </label>
                <div class="input-group">
                        <input id="password" class="form-control" tabindex="2" required="true" name="password" type="password" placeholder="6 bis 15 zeichen">
                </div>
        </div>

                <!--angemeldet bleiben-->
                <div class="form-group">
                    <div class="custom-control custom-checkbox">
                        <input type="checkbox" class="custom-control-input" name="remember" tabindex="3" value="1" id="remember">
                        <label class="custom-control-label" for="remember">Angemeldet bleiben</label>
                    </div>
                </div>

                <button type="submit" class="btn btn-primary" tabindex="4">Anmelden</button>
            </form>
abelchu 回答:第2页中的require_once('page1.php')在第2页中整体显示第1页,就像iframe

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167553.html

大家都在问