Uploading files- php
Moderator: General Moderators
Uploading files- php
how do you do it? ive tried but it wont work. whats some tutorials or scripts that show how to do this? ive been trying to make a script that uploads images to a directory selected by a drop down menu. thanx
You need to use File Upload Field on Form.
Code: Select all
<?php
$image = $_POSTї'image'];
$dir = $_POSTї'directory'];
$fh = fopen("$dir/$image","a+");
fwrite($image,$fh);
fclose($fh);
?>wait
does that work when file_uploads are turned off? i dont think mah host has it turned on...