What approach could someone suggest to save the current page as an HTML file to the server? In this case, also note that security is not an issue.
I
//function to use curl to get the content of the page.
//parameter used url and $data for the posting credentials to retrieve information.
function httpPost($url, $data){
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
//
$filename="abc.html"; // whatever name you want.
$myfile = fopen($filename, "w") or die("Unable to open file!");
$txt = httpPost(, ""); // replace by url you want.
fwrite($myfile, $txt);
fclose($myfile);