I am so confused with uploading files in PHP?

You'd better follow this tutorial: w3schools.com/php/php_file_upload.asp.

Up vote 0 down vote favorite share g+ share fb share tw.

I have tried reading multiple tutorials, the PHP documentation and have no idea what I am doing. Here is my form Now when I send that through here: $error) { if($error == UPLOAD_ERR_OK) { $check_name = $_FILES'files''name'; $filetype = checkfiletype($check_name, 'jpg,jpeg'); $temp_name = $_FILES'files''tmp_name'$key; $image_name = 'image_' . $name .

'1'; move_uploaded_file($tmp_name, $upload_dir . $image_name); } } It brings back Warning: Invalid argument supplied for foreach() in /blabla on line 18 I don't understand foreachs all too well, and when I print_r the array it dosen't help me one bit. Would someone be so kind to help me out.

Thanks. Php forms upload input link|improve this question asked Nov 1 '10 at 17:15Connor Burton359 85% accept rate.

2 $_FILES'files' needs to be $_FILES'file' – Pekka Nov 1 '10 at 17:17 @pekka yep - or needs to be – seengee Nov 1 '10 at 17:21.

You'd better follow this tutorial: w3schools.com/php/php_file_upload.asp foreach ($_FILES'file' as $file) { if($file'error' == UPLOAD_ERR_OK) { $check_name = $file'name'; // I assume you have to use the file type here, not name $filetype = checkfiletype($file'type', 'jpg,jpeg'); $temp_name = $file'tmp_name'; $image_name = 'image_' . $file'name' . '1'; move_uploaded_file($tmp_name, $upload_dir .

$image_name); } } Your files are in $_FILES'files' so using foreach you have to go over each element/file and take its data.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions