mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
g
This commit is contained in:
18
index.php
18
index.php
@@ -70,7 +70,7 @@ if(isset($_GET['v'])){
|
|||||||
function onytplayerStateChange(newState) {
|
function onytplayerStateChange(newState) {
|
||||||
if(newState == 0)
|
if(newState == 0)
|
||||||
{
|
{
|
||||||
$.ajax({
|
/*$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "save.php",
|
url: "save.php",
|
||||||
data: "thisUrl="+response,
|
data: "thisUrl="+response,
|
||||||
@@ -79,7 +79,21 @@ if(isset($_GET['v'])){
|
|||||||
console.log("saved");
|
console.log("saved");
|
||||||
console.log(response);
|
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(){
|
setTimeout(function(){
|
||||||
response = $.ajax({ type: "GET",
|
response = $.ajax({ type: "GET",
|
||||||
|
|||||||
2
save.php
2
save.php
@@ -20,9 +20,11 @@
|
|||||||
array_shift($data);
|
array_shift($data);
|
||||||
}
|
}
|
||||||
file_put_contents("videos.json", json_encode($data));
|
file_put_contents("videos.json", json_encode($data));
|
||||||
|
echo $data;
|
||||||
unset($data);
|
unset($data);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
echo "You're a bad boy";
|
echo "You're a bad boy";
|
||||||
}
|
}
|
||||||
|
die();
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user