For PHP & MySQL: The Missing Manual -- How do I write the string for the upload directory path? I am trying to implement code in Chapter 8 of the text and this seems to be the problem. I am using MAMP on my MacBook Pro (8GB RAM, 3.06GHZ Core 2 duo CPU, 27 GB HD space left of 250GB). My OS is OSX Lion (latest release). I've tried
"/MBP306 HD/Users/sams/Applications/MAMP/htdocs/..." and "/Applications/..." along with all truncations of the first and nothing works! This is very frustrating!!!
I'll get this question over to the book tech staff as well.
My advice on this issue would be the same as the previous one you posted here, that being it would probably best to contact our book support staff directly at email@example.com to help with any issues you may be having with the book.
Customer Service Rep,
Have you downloaded the example files for that book from the Missing CD page -
They have the code for that as -
$upload_dir = SITE_ROOT . "uploads/profile_pics/";
It looks like the problem is that you are trying to write a path that is outside of the web server's realm. You need to make that path somewhere inside of the htdocs folder.
I hope that helps,
O'Reilly Book Support
I have downloaded all files. And I did follow the author's instructions, but was unable to upload the file as per Chapter 8. However, when I pushed on to Chapter 9, I was able to upload the file to a table. But, then when I followed the instructions to view the file, I received a ton of garbage (binary, I think).
I have tried to build the files in order to better learn, and then, when I encountered problems, compared them to the posted files.
There are many typographical errors in this Missing Manual. However, I have used the errors as a learning exercise in debugging. I have learned much by pressing on. This approach, though, has taken me a considerable amount of time--part of the debugging I can live with. (In many cases, the correct code is in the author's files that I downloaded, but not always.)
So, I still have the problem. Is the problem related to the fact that I am using MAMP on a Mac, running OSX Lion? Or ????
So I am still in need of assistance.
Sam Sugiyama, Ph.D.
EC RISK USA & EUROPE, LLC
Sorry for the delay in getting back to you.
I was able to use MAMP with the example files for the book, so that probably isn't the problem. Did you copy all of the folders from the example code zip file to MAMP? You need the files in the other folders included there in place, such as the js, uploads, scripts, etc.... Also, you need to edit some of the lines in the app_config.php file, too.
If you've done all that and it still doesn't work, let me know and we'll see if we can get the author to help.
O'Reilly Book Support