I googled a lot to solve the problem and unfortunately i could not find a solution why the php file is downloaded instead of being executed. When the user submits the login button the next php (meine_daten.php) file that is called by the
<form action="php_file_that_is_downloaded_insted_of_being_executed.php" method=post>
tag is dowloaded.
This problem concerns one particular PC.
I have already fixed PHP erorrs and bugs using the local server (XAMPP) (display_errors = on php.ini) and (https://validator.w3.org/).
PHP header is set => Content-Type: text / html. I wonder why for all other PCs in my home or somewhere else it works fine but not on this particular PC. How can that be?
Does somebody has any idea? Is it possible that it is a firewall thing that does not allow to execute php scripts? But the index.php gets executed on this pc! The download happens when the user clicks the submit button and the <form>
tag calls the script meine_daten.php something happens during this proccess so that the file meine_daten.php is downloaded.
PS: I used Internet Explorer, firefox, Chrome and they all download the php file on this pc
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>