Form File Upload


Posted on 16th Feb 2014 07:03 pm by admin

I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but for some reason it's not working...

My HTML Form:
Code: <form action="script.php" name="update" method="post">
<input type="file" name="update_banner" size="22" /> <br />
<input type="submit" name="update_submit" value="Update Subscription" />
</form>

My Handling Script:

// if there is an update submitted...
if (isset($_POST['update_submit'])) // if the update form has been submitted
{
// if there is a file to upload...
if (isset($_FILES['update_banner']) && !empty($_FILES['update_banner']['name']))
{
// it should give me all the info about that file...
die(print_r($_FILES));
}
else
{
die("No file has been uploaded");
}
}
else
{
die("No upload has been submitted");
}


It should output all the info about that file, but I load the form, select an image from my computer, hit submit, and it tells me there is no file.

Any ideas why?

No comments posted yet

Your Answer:

Login to answer
229 Like 50 Dislike
Previous forums Next forums
Other forums

PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work s

Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:
"a.b.c.d.e.f&

Printing a webpage
I use this to print the webpage: o

need a script for 3 pages
I have a customer who wants me to set up a site with a number of pages with the following requiremen

Tracking Unique Clicks
Hi guys and gals,

Basically I have a database which tracks clicks on my outbound links, I do

Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

PHP page is blank
Hi Everyone,

I have a site in which I am able to open the first PHP webpage in my browser but

php call servlet
I have done a php backup application .
So there is a form that user pick some files to zip and d

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash