php - upload files to the server -
i worked on being able upload files web site , should hand on in folder.
it such have trouble uploading file , there no files or other things.
i need work on later of saving file info database has come server etc.
what should loaded server, pdf , mp3 , zip files , word (doc files)
i try this
<form action="#" enctype="multipart/form-data" method="post"> <table width="100%"> <tr> <td>upload</td> <td><input type="file" name="file" class="new"></td> </tr> <tr> <td>materialer</td> <td> <select name="materialer" class="new"> <?php $materialer = $mebe->materialer(); ?> </select> </td> </tr> <tr> <td>file type</td> <td> <select name="materialer" class="new"> <?php $file_type = $mebe->file_type(); ?> </select> </td> </tr> <tr> <td></td> <td><input type="submit" name="upload_telefon" value="upload" class="new"></td> </tr> </table> </form> <?php if(isset($_post["upload_telefon"])) { $upload_file_typer_indhold = $mebe->upload_file_typer_indhold(); } ?> function upload_file_typer_indhold() { if($_files["file"]["error"] > 0) { echo "" . $_files["file"]["error"] . ""; } else { move_uploaded_file($_files["fil1"]["tmp_name"], "upload/undervisning/"); } }
when tried upload, says this:
this site not accessible , standing there on side also.
you should use filename instead of '#':
<?php echo basename(__file__); ?>
Comments
Post a Comment