This commit is contained in:
Kasper Rynning-Tønnesen
2014-08-08 17:52:43 +02:00
parent a2d7de1a8c
commit b610406d5a
3 changed files with 22 additions and 20 deletions

View File

@@ -1,20 +1,20 @@
<?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_shift($data);
}
file_put_contents("videos.json", json_encode($data));
unset($data);
}else
{
echo "You're a bad boy";
}
?>