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 - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,

This is my first time on your website and please excuse if I am asking silly que

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

Help on code output
My CODE:

Code: [Select] echo "<phone>".$line["phone"].&qu

column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam

Running a cron job through PHP/Apache?!
Hello all,
I have a PHP script which makes a cron file from user input. When i try to run the cro

Consuming third party Payment Gateway API from Procedure.
Hi All,

First of all i would like to thank all the people of the oracle forum for providi

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,

In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.

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