Page 1 of 1

Uploading files- php

Posted: Sat Sep 14, 2002 11:15 pm
by pb2ya
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

Posted: Sun Sep 15, 2002 12:11 am
by dusty
look at the copy function

Posted: Sun Sep 15, 2002 3:11 am
by Takuma
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

Posted: Sun Sep 15, 2002 3:18 pm
by pb2ya
does that work when file_uploads are turned off? i dont think mah host has it turned on...