Jump to content
Larry Ullman's Book Forums

Chapter 19, Script 19.2


Recommended Posts

Hi there,

 

Can you help me with the script 19.2. please?

 

The problem is that though I uploaded the size-allowed image to uploads folder, which is in the same directory as add_print.php file, but it failed and the error message says 'No file was uploaded.' . You can test it here (http://hiteachers.com/add_print.php)

 

Note: As the uploads folder is on the same level as the add_print.php, and I don't create the admin folder either, I change the paths for $temp from '../../uploads/' . md5($_FILES['image']['name']); to $temp = './uploads/' . md5($_FILES['image']['name']); and for rename from ($temp, "../../uploads/$id"); to rename ($temp, "./uploads/$id");

 

Is it the cause of the problem or what else?

 

Thanks for your help in advance.

 

Regards,

Ericp

Link to comment
Share on other sites

Sorry, but the name of the book i am discussing about is PHP and MYSQL for Dynamic web sites, 4th Edition, Copyright © 2012 by Larry Ullman.

 

So, can you help me move this topic to the appropriate book's forum, please?

 

Thanks and regards,

 

Ericp

Link to comment
Share on other sites

I successfully configured this already. The problem was at godaddy server.

 

If you guys out there use Godaddy sharing hosting plan (Linux), you need to create a php5.ini file with the code to reset the upload_tmp_dir  to /tmp value instead of No Value by default.

 

the code is upload_tmp_dir = /tmp

  • Upvote 1
Link to comment
Share on other sites

Kudos for figuring it out and thanks for sharing what you learned. That being said, this surprises me some, as I thought PHP would use the /tmp directory automatically if no value is set. But perhaps GoDaddy has its servers configured differently.

Link to comment
Share on other sites

 Share

×
×
  • Create New...