我在我的执行网站上收到此通知:
Notice: Undefined variable: _SESSION in *PATH* on line 25
这是这行代码$_SESSION["Registration_Error"] = TRUE;
为什么 $_SESSION-Variable 未知?
他们是否改变了在 Session-Variable/Cookie 中保存数据的方式?
在 Google 上没有找到好东西。只是这个http://php.net/manual/de/book.session.php#116217我不认为这有多大帮助。
想法?
编辑:
完整代码
<?php
session_start();
function __autoload($class_name) {
include "../backend/classes/$class_name.php";
}
$Connection = new DB_Connect();
$User_Functions = new User_Functions();
$UserName = filter_input(INPUT_POST, "UserName");
$Password = filter_input(INPUT_POST, "Password");
$Mail = filter_input(INPUT_POST, "Mail");
$date = new DateTime();
$Registration_Date = $date->format("Y-m-d H:i:s");
if (!empty($UserName) && !empty($Password) && !empty($Mail)) {
if (!$User_Functions->User_Exists($UserName)) {
$Password_hashed = password_hash($Password, PASSWORD_DEFAULT);
$Query = "INSERT INTO wordsusers (`wordsUserName`, `wordsUserPassword`, `wordsUserMail`, `wordsUserRegDate`) VALUES (:wordsUserName, :wordsUserPassword, :wordsUserMail, :wordsUserRegDate)";
$Parameter = array(":wordsUserName" => $UserName, ":wordsUserPassword" => $Password_hashed, ":wordsUserMail" => $Mail, ":wordsUserRegDate" => $Registration_Date);
$Registered = $Connection->Execute_PDO_Command($Query, $Parameter);
} else {
$_SESSION["Registration_Error"] = TRUE;
header("Location: ../index.php");
}
}