您好我有cron作业,它将文件保存到数据库。当cron作业工作时,它将文件保存到根目录。我不明白为什么它保存文件。比我从godaddy问过。他们告诉我这不是服务器问题检查你的代码。是否可以停止保存文件?我的代码是:
<?php
header('Content-type: text/plain; charset=utf-8');
require_once "lib/connect.php";
if(isset($_GET['page_id'])){
function savezar1($name,$video) {
$sql = "INSERT INTO videos (`video` , `name`,`yes`)
VALUES ('$video', '$name','1')";
mysql_query($sql)or die ("MySQL Error :".mysql_error());
}
$page_id = $_GET['page_id'];
$access_token = 'facebook access token';
$json_object = @file_get_contents('https://graph.facebook.com/' . $page_id .
'/feed?access_token=' . $access_token);
$fbdata = json_decode($json_object);
foreach ($fbdata->data as $post )
{
$content=$post->message;
$title=$content;
$title=strip_tags($title);
$title=trim($title);
$title=mysql_real_escape_string($title);
$l=$post->id;
$q=explode("_", $l);
$l='<div id="fb-root"></div><script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; fjs.parentNode.insertBefore(js, fjs);}(document, "script", "facebook-jssdk"));</script><div class="fb-video" data-allowfullscreen="1" data-href="https://www.facebook.com/'.$q[0].'/videos/'.$q[1].'/"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/'.$q[0].'/videos/'.$q[1].'/"><a href="https://www.facebook.com/'.$q[0].'/videos/'.$q[1].'/"></a><p>'.$title.'</p></blockquote></div></div>';
$video=htmlspecialchars($l, ENT_QUOTES);
$rsurl=isHaveUrl($title);
if($rsurl==0)
{
savezar1($title,$video);
}
}
}
?>
答案 0 :(得分:0)