mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
main url fix
This commit is contained in:
45
save.php
45
save.php
@@ -1,21 +1,26 @@
|
||||
<?php
|
||||
|
||||
if(isset($_POST['thisUrl']))
|
||||
|
||||
{
|
||||
|
||||
$string = $_POST['thisUrl'];
|
||||
|
||||
|
||||
|
||||
$file = file_get_contents('videos.json');
|
||||
|
||||
$data = json_decode($file);
|
||||
|
||||
unset($file);//prevent memory leaks for large json.
|
||||
|
||||
//insert data here
|
||||
|
||||
if($data[0] == $string)
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_POST['thisUrl']))
|
||||
{
|
||||
$string = $_POST['thisUrl'];
|
||||
$file = file_get_contents('videos.json');
|
||||
$data = json_decode($file);
|
||||
unset($file);//prevent memory leaks for large json.
|
||||
|
||||
//insert data here
|
||||
|
||||
if($data[0] == $string)
|
||||
{
|
||||
array_push($data, $string);
|
||||
array_shift($data);
|
||||
}
|
||||
|
||||
file_put_contents("videos.json", json_encode($data));
|
||||
unset($data);
|
||||
|
||||
}else
|
||||
{
|
||||
echo "You're a bad boy";
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user