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

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

I need to increse 6hours more, and i don't know how???
I need to increse 6hours more, and i don't know how???
<tr>
<t

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

Check if another session of the page is running?
I want to keep people from opening multiple tabs, or sessions of my Facebook app. Is it possible to

Unexpected T_Variable ?
Hi all,
I dont really know what I am doing!! I know I'm doing something wrong, and I know its on

Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are

Database connection failure
Hello All,

I am trying to create new connection to Oracle DB 10.1,
I could not see a

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

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