<?php
//文件下载
$host = $config['DB_HOST'];
$port = $config['DB_PORT'];
$user = $config['DB_USER'];
$pwd = $config['DB_PWD'];
$conn = @ mysql_connect($host.":".$port, $user, $pwd) or die("{'status':0,'msg':'Database connection error'}");
if($dbconn=mysql_select_db($config['DB_NAME'], $conn)){
}else{
echo("Could not connect to mysql");
}
$sql = "SELECT link FROM `frame` where cid=1";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
$imagesURL = $row['link'];
file_put_contents(basename($imagesURL), file_get_contents($imagesURL));
?>
//文件下载
$host = $config['DB_HOST'];
$port = $config['DB_PORT'];
$user = $config['DB_USER'];
$pwd = $config['DB_PWD'];
$conn = @ mysql_connect($host.":".$port, $user, $pwd) or die("{'status':0,'msg':'Database connection error'}");
if($dbconn=mysql_select_db($config['DB_NAME'], $conn)){
}else{
echo("Could not connect to mysql");
}
$sql = "SELECT link FROM `frame` where cid=1";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
$imagesURL = $row['link'];
file_put_contents(basename($imagesURL), file_get_contents($imagesURL));
$i++;
}
echo $i;?>