Re: Simple Form Processing

From: Date: Sun, 12 Jan 2003 12:39:40 +0000
Subject: Re: Simple Form Processing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131328@lists.php.net to get a copy of this message
This is what I tried: if (is_uploaded_file($HTTP_POST_FILES['image1']['image1']) { move_uploaded_file($HTTP_POST_FILES['image1']['image1'], "$DOCUMENT_ROOT/images/$file"); } and also this: if (is_uploaded_file($_FILES['image1']['image1']) { move_uploaded_file($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images/$file"); } and this: if (is_uploaded_file($_FILES['image1']['image1'])) { copy($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images"); } ,the image (which was within the size range) was never uploaded. I have a feeling that I am makeing 1 or 2 of the same mistakes in all three but through my experimenting and reading I am having no luck. I also bought Programming PHP but I trust it less and less as I even find simple mistakes like missing quotes in example code. So what's going wrong? Thank you again, Kyle On Sun, 12 Jan 2003 15:17:42 +1100, "Justin French" <justin@indent.com.au> said: > Hi, > > the files themselves are available in the $_FILES array, but it's not as > simple as that. > > may i recommend you start by copying the Examples 18-1 and 18-2 from this > page: > http://www.php.net/manual/en/features.file-upload.php > > Once you've got THAT code working smoothly and understand what's > happening, > THEN start modifying it to a 3-file form. > > I'd personally push forms through using POST method rather than get > whenever > possible -- especially when dealing with files... the manual does it this > way too :) > > > Justin > > > > on 12/01/03 12:18 PM, Kyle Babich (php@kyle.sent.com) wrote: > > > I just broke skin with php and I'm learning forms, which I'm not good > > with at all. These are snippets from post.html: > > > > <form method="get" action="process.php" > > enctype="multipart/form-data"> > > and > > <input type="file" name="image1" maxlength="750" > > allow="images/*"><br> > > <input type="file" name="image2" maxlength="750" > > allow="images/*"><br> > > <input type="file" name="image3" maxlength="750" > > allow="images/*"><br> > > > > but how would I pass the actual image on because when I do something like > > this: > > <?php echo "{$_GET[image1]}"; > > ?> > > as you could probably guess only the filename prints. > > > > So how do I take the image instead of just the filename? > > > > Thank you, > > -- > > Kyle > >

« previous php.general (#131328) next »