Uploading files- php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pb2ya
Forum Commoner
Posts: 42
Joined: Sat Jul 06, 2002 5:20 pm
Location: ATL
Contact:

Uploading files- php

Post 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
dusty
Forum Contributor
Posts: 122
Joined: Sun Apr 28, 2002 9:52 pm
Location: Portsmouth, VA

Post by dusty »

look at the copy function
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post 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);
?>
pb2ya
Forum Commoner
Posts: 42
Joined: Sat Jul 06, 2002 5:20 pm
Location: ATL
Contact:

wait

Post by pb2ya »

does that work when file_uploads are turned off? i dont think mah host has it turned on...
Post Reply