how to get values from $_Post with onchange="form.submit();"?


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

Hi, I have a form that submit to itself with a file upload field and two other hidden field values.
If I put a submit button on the page, all is working fine.

I don't like the submit button as its wasting space. So I want to use
Code: <input size="10" type="file" name="img1" onchange="image.submit();">
If I add Code: print_r($_FILES); I do get the array but the
Code: if(isset($_POST['submit'])){}does nothing...

My form is as follow.....
Code: <form method="POST" name="image" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" >
<table>
<input id="ad" name="ad" value="<?php echo $adnr;?>" type="hidden"/>
<input id="user" name="user" value="<?php echo $user;?>" type="hidden" />
<tr><td><input size="10" type="file" name="img1" onchange="image.submit();"></td></tr>
<tr><td><input type="submit" name="upload" value="Upload"></td></tr>
</table>

</form>

No comments posted yet

Your Answer:

Login to answer
130 Like 7 Dislike
Previous forums Next forums
Other forums

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

BI in Upstream Production operations
Appreciate if you can assist in the following areas:
1) Examples of life before and after BI i

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.

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

Any help with my email script?
I have an email script, I have not tested it, although someone tested it for me and said it worked f

Undefined variable: adHTML
Hello:

While checking my site error logs, I've noticed one repetitive error that fills the lo

Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one n

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

Convert Binary String to Decimal
Trying to Get:
Decimal: 305419896

Out of:
Binary String: xV4

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

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