skip to Main Content

Php versions – Downloading files via PHP problem on webserver

Could someone help me with a little PHP problem? This is my code: $mr = mysqli_fetch_assoc($ms); header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename="" . basename($mr['flink']) . """); readfile($mr['flink']); header("Location: ref.php?action=viewdeti&id=".$_GET['id']); Where $mysqli is my mysql connection and $id is $_GET['id'].…

VIEW QUESTION

file_get_contents() returning empty even though allow_url_fopen = On – Apache

Problem file_get_contents() is returning an empty string for some reason. Code index.php <?php $value = file_get_contents("http://foo.com/somefile.txt"); echo $value; ?> php.ini allow_url_fopen = On allow_url_include = On http://foo.com/somefile.txt 69.00000000 My Research Generally when file_get_contents("http://foo.com/somefile.txt") returns an empty string, it is due…

VIEW QUESTION

PHP Chmod function not workiing – CPanel

Whenever I try to delete a file from my cpanel folder from my webpage using this code $oldFile = @mysql_result(mysql_query("SELECT SUBSTR(`materialLink`, 27) FROM `documents` WHERE `iddocuments` = '$iddoc'"),0, `materialLink`); $chmod = "0777"; chmod($oldFile,octdec($chmod)); $oldFile = 'https://www.edutopia.co.ke'.$oldFile; if(isset($_POST['Fild'])){ $msg1 = '<script…

VIEW QUESTION
Back To Top
Search