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

Parse XML
Good day,

I use oempro software and try to parse XMLReturn but it's not working for me, simpl

Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat n

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

cURL error
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8
Because

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

Displaying a clickable playername
I am going wrong somewhere with the mysql_query, can someone please put me straight?

$playern

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

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