I am very new to php. I have a pdf file at the absolute location "/home/abc/def.pdf". I have a php code (displaypdf.php) in /var/www/html which looks like
<?php
$pdfloc = $_GET['pdfl'];
if (file_exists($pdfloc)){
if (!copy($pdfloc, '/tmp/temp.pdf')) {
echo " destination file not found";
}
else {
echo " file copied";
}
}
else {
echo " source file not found";
}
?>
when I do http://localhost/displaypdf.php?pdfl="/home/abc/def.pdf"
it says "source file not found" but I do have the source file with -rwxr-xr-x
permission. What am I doing wrong?