PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi there. i am putting a media page on my website which uses mysql. i have written the two scripts and everything is working apart form uploading. i dont know how to make it upload to a certain folder and the insert just the file name into the database (ie. upload from C:/my documents/web stuff/music/song.mp3 uploads it to a space on the server and adds song.mp3 to the database.)
the codes i have written so far are -
Warning: move_uploaded_file(http://eric.madashatters.com/media/1.jpg): failed to open stream: HTTP wrapper does not support writeable connections. in /home/madashat/public_html/eric/media/test.php on line 9
Warning: move_uploaded_file(): Unable to move '/var/tmp/php5ZIDQe' to 'http://eric.madashatters.com/media/1.jpg' in /home/madashat/public_html/eric/media/test.php on line 9
Possible file upload attack!
Here is some more debugging info:Array
(
їuserfile] => Array
(
їname] => 1.jpg
їtype] => image/pjpeg
їtmp_name] => /var/tmp/php5ZIDQe
їerror] => 0
їsize] => 38935
)
)
i have had a read of the move_uploaded_file but dont quite understand what it is used for or where to put it :s could you explain it for me please.