mirror of https://github.com/IoTcat/acg.watch.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
602 B
41 lines
602 B
<?php |
|
include '../functions.php'; |
|
|
|
$url = $_REQUEST['url']; |
|
|
|
if(!isset($url)) die(); |
|
|
|
$conn = db__connect(); |
|
|
|
if(!db__rowNum($conn, "video", "url", $url)) { |
|
echo json_encode(array( |
|
name => "首选", |
|
url => $url |
|
)); |
|
die(); |
|
} |
|
|
|
|
|
$res = db__getData($conn, "video", "url", $url); |
|
|
|
$arr = Array(); |
|
|
|
array_push($arr, array( |
|
name => "首选", |
|
url => $url |
|
|
|
)); |
|
|
|
for($i = 1; $i <= 3; $i ++){ |
|
if($res[0]["url".$i] !== ""){ |
|
array_push($arr, array( |
|
name => "备选".$i, |
|
url => $res[0]["url".$i] |
|
)); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
echo json_encode($arr);
|
|
|