This commit is contained in:
Kasper Rynning-Tønnesen
2014-08-08 18:25:55 +02:00
parent cd18ef7cab
commit 31dbbf01e3
2 changed files with 18 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ if(isset($_GET['v'])){
function onytplayerStateChange(newState) {
if(newState == 0)
{
$.ajax({
/*$.ajax({
type: "POST",
url: "save.php",
data: "thisUrl="+response,
@@ -79,6 +79,20 @@ if(isset($_GET['v'])){
console.log("saved");
console.log(response);
}
});*/
$.ajax({
type : 'post',
//dataType : '', // http://en.wikipedia.org/wiki/JSON
url : 'save.php',
data : "thisUrl="+response,
success: function(ans) {
if( ans.type == 'success' ) {
alert('Bravo! ' + ans.result);
} else {
alert('Error!');
};
}
});
setTimeout(function(){

View File

@@ -20,9 +20,11 @@
array_shift($data);
}
file_put_contents("videos.json", json_encode($data));
echo $data;
unset($data);
}else
{
echo "You're a bad boy";
}
die();
?>