Jump to content

Darrell_G

New Members
  • Posts

    7
  • Joined

  • Last visited

Darrell_G's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think the problem that I thought I had was caused by echo var_dump($a) and I was getting string(25) "John_Joe_Doe". I should have been using echo $a.
  2. I made the changes you recommended and it works. Where is the remote file inclusion vulnerability? What is the cause?
  3. I stumbled on the answer. I am still working through why it works. Here is my code. <?php $fname = isset($_POST['fname']) ? $_POST['fname'] : ""; $lname = isset($_POST['lname']) ? $_POST['lname'] : ""; $path = "$fname*$lname.pdf"; $a = glob($path); $b=($a[0]); $cd=($b); $cc = ("$cd"); header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' . $cc . '"'); header("Content-Length: " . filesize($a)); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); readfile($cc); ?>
  4. I have exhausted everything I know what to do. I have gotten as far as I can. I have gotten from "Array ( [0] => John_Joe_Doe.pdf )" to "John_Joe_Doe.pdf1". Nothing I do will get rid of the "1". Another clue pointing where to look would be apreciated.
  5. No. I'm a beginner. How do I get "John_Joe_Doe.pdf " into $file from "Array ( [0] => John_Joe_Doe.pdf )" in PHP ?
  6. I see that problem now. What can I do about it?
  7. <?php $fname = isset($_POST['fname']) ? $_POST['fname'] : ""; $lname = isset($_POST['lname']) ? $_POST['lname'] : ""; $file=(glob("Recordings/$fname*$lname.pdf")) ; //header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' . $file . '"'); header("Content-Length: " . filesize($file)); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); // Read the file //readfile($file); print_r($file); ?> will print Recordings/John_Joe_Doe.pdf as expected. remove // from lines 5 & 11 and add // to line 12 and the browser opens a pdf page and says unable to load file. Change line 4 to $file=("Recordings/$John_Joe_Doe.pdf"); and the pdf file will open in the browser. Where am I going wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.