Changement du header() à une solution Javascript

This commit is contained in:
lars 2019-03-11 13:47:58 +01:00
parent 31c81b6069
commit a38230db40

View File

@ -2,7 +2,7 @@
require_once 'vendor/autoload.php';
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL & ~E_NOTICE );
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING );
session_start();
$userid = $_SESSION['uid'];
@ -14,12 +14,12 @@ require_once 'vendor/autoload.php';
$isEditable = $_SESSION['allowedit']==1;
if(!$userid) {
syslog(LOG_ERR, "Unauthorized access to form page aid:$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
header('Location: accred_list');
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
die();
}
if(!$isAdmin && $isEditable!=1) {
syslog(LOG_ERR, "Unauthorized access to form page aid by non editable user :$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
header('Location: accred_list');
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
die();
}
@ -27,7 +27,7 @@ require_once 'vendor/autoload.php';
$uname = $_SESSION['name'];
if($_POST['btncancel']) {
header('Location: accred_list');
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
die();
}
$prices = array(
@ -138,8 +138,7 @@ if (!$mysqli->query($query) ) {
echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error;
die("Argh");
}
header('Location: accred_list');
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
die();
}