まず、ファイルへのアクセスを許可するために、
php.iniでallow_url_fopenの設定をtrueにしてください。
$url = 'http://example.co.jp/image.php'; $img = '/my/folder/flower.gif'; file_put_contents($img, file_get_contents($url));
もしくは、cURLを使うと以下のように書けます。
$ch = curl_init('http://example.co.jp/image.php'); $fp = fopen('/my/folder/flower.gif', 'wb'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch);
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。