PHP uploads file - enctype="multipart/form-data" issue -
i have upload code. there no problem running individually, when try add other codes, did not $_files parameter. im guessing becoz of enctype="multipart/form-data" in form tag, based on post:
the enctype needed. problem is, how can upload files without concern this? can juz change code structure compatible other codes?
if($_post['check']){ $faillampiran=$_post['faillampiran']; $file=$_files['faillampiran']["name"]; $filesize = $_files['faillampiran']['size']; $filetype = $_files['faillampiran']['type']; if ($_files["faillampiran"]["error"] > 0 ) { echo "return code: " . $_files["faillampiran"]["error"] . "<br />"; } else { move_uploaded_file($_files["faillampiran"]["tmp_name"],"upload/" . $_files["faillampiran"]["name"]); echo '<table align = "center">'; echo "<tr><td>"; echo "your file has been stored."; echo "</td></tr>"; echo '</table>'; } } ?> <form method="post" name="form1" id="form1" enctype="multipart/form-data"> <tr><td></td><td><input type="hidden" name="max_file_size" value=""> </td> </tr> <tr><td> please choose file</td><td>:</td></tr> <tr> <input type="file" size="50" name="faillampiran" alt="faillampiran" id="faillampiran" 1value= "<?=$faillampiran;?>" /> <tr align = "center"><td colspan = "3"><input type="submit" value="hantar" name="check"/></td></tr> </tr></form>
thank you.
you do have include enctype in form, don't think there's way around that, , reason.
just add other forms too, did here.
Comments
Post a Comment