Code: Select all
//get html file and save on server as text
$ch = curl_init("http://site.com/file.html");
$fp = fopen("/home/username/public_html/text/file.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);Only the php script needs access to these text files, so would it be safer to write them in a directory outside of public_html?