Html/php code not behaving as expectedAutor: Dave R.
I am developing using xampp with mysql and php before uploading to the world
I have a simple files upload file routine which works in a standalone .php file
When I embed this code into a website X5 php page using the HTML code object it fails with 'Warning: Undefined array key "ufile" '
Here is the code simplified for ease of inspection.
here's the form for gathering the files
<div class="form-popup" id="picsForm" style = "width:20em;">
<label style = "width:20em;">If you have pictures, upload them here.</label>
<form method="post" action="" enctype="multipart/form-data">
<input name="ufile" id="file" type="file" multiple="multiple" >
<input type='submit' name='pics' style=" margin-top:8px; float:right; height:2em; background-color: #7B9BF5;" value='Upload pictures'>
now the php for collection and storing the uploaded files
$total_count = count($_FILES['ufile']['name']);
for( $i=0 ; $i < $total_count ; $i++ )
$tmpFilePath = $_FILES['ufile']['tmp_name'][$i];
$newFilePath = $_SERVER['DOCUMENT_ROOT'] ."/pics/" . $_FILES['ufile']['name'][$i];
// do stuff
Any help would be appreciated thank you