Using PHP to upload

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

Locked
tonyacunar
Forum Newbie
Posts: 8
Joined: Thu May 11, 2006 11:03 am

Using PHP to upload

Post by tonyacunar »

Hello, I want users to be able to upload images to my server. I tried using the code from the PHP manual website but my servers PHP log catches a syntax error where there is none. I have a folder called images, and my apache/php is set to accept files. Here is the code perhaps you guys have any tips or another tutorial.
thanks

this is my first file, i dont think it has anything wrong with it
index.html

Code: Select all

<form enctype="multipart/form-data" action="uploader.php" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Moved to code and added code tags.

please use code tags when posting code in the forums.

edit:
was there a quesiton wrapped up in there somewhere?
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: Using PHP to upload

Post by jmut »

tonyacunar wrote:Hello, I want users to be able to upload images to my server. I tried using the code from the PHP manual website but my servers PHP log catches a syntax error where there is none. I have a folder called images, and my apache/php is set to accept files. Here is the code perhaps you guys have any tips or another tutorial.
thanks

this is my first file, i dont think it has anything wrong with it
index.html

Code: Select all

<form enctype="multipart/form-data" action="uploader.php" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>
could you elaborate on your PHP log. It is hard to believe it just reads error...without any detail.
User avatar
$phpNut
Forum Commoner
Posts: 40
Joined: Tue May 09, 2006 5:13 pm

Post by $phpNut »

Are you asking for the php, that uploads it file (or really moves it from temp file to your directory)?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
Locked