I*added at the top of the script these lines:
and now get this:
Which is much clear now. So the problem must be with the destination.
Warning: move_uploaded_file(/home/wojtek/public_html/headfirst/ch05/guitarwars/images/001.jpg): failed to open stream: Permission denied in /home/wojtek/public_html/headfirst/ch05/guitarwars/addscore.php on line 38 Warning: move_uploaded_file(): Unable to move '/srv/www/tmp/phpCb8m0M' to '/home/wojtek/public_html/headfirst/ch05/guitarwars/images/001.jpg' in /home/wojtek/public_html/headfirst/ch05/guitarwars/addscore.php on line 38 upload failed
Following the advice on php.net, I*changed the user of images/ to ‘nobody’ and its rights to ’755’. But still with no success.
OK, I restored the ownership to my user (wojtek) and gave it 777 rights. Now it works!
The next issue that bothers me is how should I*set the destination? Is it OK*to give the whole, absolute path like this one:
// define application constants
Can I*for example to make use of relative paths? Kinda ‘/~wojtek/headfirst/ch05/guitarwars/images/’?