Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2011, 02:03 PM
Authorized User
 
Join Date: Jul 2009
Posts: 77
Thanks: 4
Thanked 6 Times in 6 Posts
Default Chapter 6, a solution for downloading files from subdirectories

In Chapter 6 there is a problem downloading files from
directories below the base directory (BASEDIR).

In filemanager.js there is a call to download.php. The
parameters passed to this download.php function are being passed by a query string.
In download.php, they are trying to get the directory.
The code is using $_POST['dir'] for the directory parameter. It
it should be using $_GET['dir']

In the book, Chapter 6, page 160, in the section that has the code for
download.php, line 6 is as follows and this is not correct.

$dir = BASEDIR . $_POST['dir'];

It should use GET instead, and look like this.

$dir = BASEDIR . $_GET['dir'];


If you don't make this change you will not be able to download files
from directories below the base directory (BASEDIR).

Last edited by kenj; August 8th, 2011 at 03:37 PM.. Reason: adding a specific detail





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7, Online Photo Album, Ajax, cannot upload to subdirectories - here is the so kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 March 31st, 2010 09:19 PM
Downloading files via a browser gfrank1157 ASP.NET 2.0 Basics 3 June 14th, 2006 04:13 PM
Problem downloading sensitive files mat41 Classic ASP Professional 1 May 4th, 2006 08:45 PM
Protect Files from downloading asif_sharif ASP.NET 1.0 and 1.1 Professional 6 January 11th, 2006 01:59 AM
downloading files serge Classic ASP Professional 4 September 8th, 2003 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.