Guten Abend, ich habe ein kleines Problem mit meinem PHP Code.
Error:
Warning: Array to string conversion in C:\Users\ali20\Documents\Video Platform\Player\index.php on line 6
Warning: Undefined property: stdClass::$Array in C:\Users\ali20\Documents\Video Platform\Player\index.php on line 6
Warning: Trying to access array offset on value of type null in C:\Users\ali20\Documents\Video Platform\Player\index.php on line 6
Warning: Attempt to read property "name" on null in C:\Users\ali20\Documents\Video Platform\Player\index.php on line 6
Error 723#1
index.php:
<?php
$data = file_get_contents("../SystemData.json");
$data = json_decode($data);
if(isset($_GET['title'])){
if(!empty($_GET['title'])){
$checkTitle = $data->$_GET['title']->name;
if(isset($checkTitle)){
$title = $_GET['title'];
}else{
echo "Error 723#1";
exit;
}
}else{
echo "Error 723#2";
exit;
}
}else{
echo "Error 723#3";
exit;
}
?>
SystemData.json:
{
"7293746918450916": {
"name": "Ein Film Name",
"poster": "x",
"source": "film.mp4"
}
}
Aufgerufene URL:
http://localhost:3000/Player/index.php?title=7293746918450916