require_once ('page1.php') на странице 2 показывает страницу 1 в целом на странице 2 как iframe - PullRequest
0 голосов
/ 04 ноября 2019

Я просто хотел использовать ввод с другой страницы на текущей странице, чтобы показать, что набрал пользователь. Но вместо этого вся страница, с которой поступает ввод, появляется на странице, как iframe. Я попытался включить и я поместил требование один раз в голову, но это не сработало.

Это страница 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>
...