下载PHP文件而不是执行

时间:2016-09-30 10:50:04

标签: php download

我google了很多来解决这个问题,很遗憾我找不到解决方案为什么要下载php文件而不是执行。当用户提交登录按钮时,

调用的下一个php(meine_daten.php)文件

<form action="php_file_that_is_downloaded_insted_of_being_executed.php" method=post>

标签已下载 这个问题涉及一个特定的PC。 我已经使用本地服务器(XAMPP)(display_errors = on php.ini)和(https://validator.w3.org/)修复了PHP erorrs和bug。

PHP标头设置=&gt; 内容类型:text / html 。我想知道为什么我家里或其他地方的所有其他电脑都工作正常,但不是在这台特定的电脑上。怎么可能? 有人有什么想法吗?它是否可能是防火墙,不允许执行PHP脚本?但是index.php会在这台电脑上执行!下载发生在用户单击提交按钮并且<form>标记调用脚本meine_daten.php时,在此过程中发生了某些事情,以便下载文件meine_daten.php。

PS:我使用的是Internet Explorer,firefox,Chrome,他们都在这台电脑上下载了php文件

的index.php:

<?php
session_start();

if (isset ( $_SESSION ['BRollenID'] )){

    session_unset ();
    $_SESSION ['BRollenID'] = null;
    session_destroy ();


}

header ( 'Content-Type: text/html; charset=utf-8' );
?>


<!DOCTYPE html>


<html lang="de">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="pics/symbole/favicon.ico">

<title>Login</title>

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="css/login/ie10-viewport-bug-workaround.css" rel="stylesheet">

<!-- Custom styles for this template -->

<link href="css/login/signin.css" rel="stylesheet">

</head>

<body>

    <div class="container">

        <form class="form-signin" action="meine_daten.php" method="post">
            <h2 class="form-signin-heading">BENUTZER-LOGIN</h2>
            <label for="inputEmail" class="sr-only">Email address</label>
            <input type="email" id="inputEmail" name="email" class="form-control" placeholder="E-Mail"
                required autofocus>
            <label for="inputPassword" class="sr-only">Password</label>
            <input type="password" id="inputPassword" name="pass" class="form-control" placeholder="Passwort"
                required>

            <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
            <a href="neuer_zugang.php" class="btn btn-lg btn-primary btn-block" role="button">Neuer Benutzer</a>

            <div style="text-align: center; margin-top: 10px">
                <a href="kennwort_vergessen.php" role="button">Kennwort vergessen</a>

            </div>
        </form>

    </div>






    <div style="text-align: center">
        <img src="pics/logos/logo_tchibo.png" alt="DB Schenker Logo">
    </div>


    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="js/login/ie10-viewport-bug-workaround.js"></script>
</body>

</html>

meine_daten.php:

<!DOCTYPE html>
<html lang="de">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="pics/symbole/favicon.ico">


<title>Meine Daten</title>

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/main/jasny-bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="css/main/navmenu.css" rel="stylesheet">

</head>

<?php
header ( 'Content-Type: text/html; charset=utf-8' );

session_start ();
require 'user_check.php';

?>


<body>

    <div class="container" style="margin-top: 15px">
        <img src="pics/logos/logo_tchibo.png" alt="Logo Tchibo">
        <img src="pics/logos/logo_schenker.png" alt="Logo DB Schenker">
    </div>
    <div class="navmenu navmenu-default navmenu-fixed-left offcanvas-sm">
        <a class="navmenu-brand visible-md visible-lg" href="#">Open Filing System</a>
        <ul class="nav navmenu-nav">

            <?php   require 'load/load_navigation.php'?>
            <script type="text/javascript">
                    document.getElementById("meine_daten").className = "active";
            </script>
        </ul>

    </div>

    <div class="navbar navbar-default navbar-fixed-top hidden-md hidden-lg">
        <button type="button" class="navbar-toggle" data-toggle="offcanvas" data-target=".navmenu">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Tchibo</a>
    </div>

    <div class="container">
        <div class="page-header">
            <h1>Meine Daten</h1>
        </div>


        <form class="form-horizontal" action="send/setangaben.php" method="post">


                <?php require 'load/load_meine_daten.php';?>
                <div class="row">
                <div class="form-group" style="text-align: center;">

                    <button type="submit" class="btn btn-default">Angaben ändern</button>
                    <button type="submit" class="btn btn-default">Abbruch</button>

                </div>
            </div>




        </form>


        <form action="send/setpass.php" method="post">
            <div class="form-group">
                <label class="control-label col-sm-2" for="pwd_aktuell">Aktuelles Passwort</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="pwd_aktuell" placeholder="aktuelles Passwort">

                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-sm-2" for="pwd_neu">Neues Passwort</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="pwd_neu" placeholder="neues Passwort">

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2" for="pwd_bestaetigen">Neues Passwort bestätigen</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="pwd_bestaetigen"
                        placeholder="neues Passwort bestätigen">

                </div>
            </div>

            <div class="row">
                <div class="form-group" style="text-align: center;">
                    <button type="submit" class="btn btn-default">Passwort ändern</button>
                    <button type="submit" class="btn btn-default">Abbruch</button>

                </div>
            </div>
        </form>

    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/main/jquery-1.10.2.min.js"></script>
    <script src="js/main/jasny-bootstrap.min.js"></script>


</body>

</html>

0 个答案:

没有答案