I want to require a file to be downloaded upon the user visiting a web page with PHP. I think it has something to do with file_get_contents, but am not sure how
file_get_contents
header("Content-Type: application/octet-stream"); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename=\"file.exe\""); echo readfile($url);
is correct
or better one for exe type of files
header("Location: $url");