Comments (4)
Files uploaded though html forms can be accessed in the $_FILES array, not the
$_POST array. When the form is submitted, try doing a print_r on the $_FILES
array
and you should see your file information.
Also, the addFile function only accepts three values following the format
provided
below...
function addFile($label, $name, $additionalParams="")
Please let me know if you have any additional questions and I will assist.
Thanks,
- Andrew
Original comment by [email protected]
on 13 Mar 2010 at 5:55
- Changed state: Done
from php-form-builder-class.
Hi.
Kind greetings from Germany :-)
Thanks for this very very fast reply!
> Files uploaded though html forms can be accessed in the $_FILES array, not
> the $_POST array.
Ah, ok.
You should make a note in the example pages to point this out.
> When the form is submitted, try doing a print_r on the
> $_FILES array
> and you should see your file information.
Nope. It still not work.
>
> Also, the addFile function only accepts three values following the format
> provided
> below...
>
> function addFile($label, $name, $additionalParams="")
Ok then something is wrong.
When you look at the elements example page you see this.
After:
//Below you will find functions for adding each of the 18 supported form field
types.
[..]
function addFile($label, $name, $value="", $additionalParams="")
> Please let me know if you have any additional questions and I will assist.
Here we go:
I have tried this:
$form->addFile("File:", "field13"));
And
echo "The File Vars:";
print_r($_FILE);
right after the print_r($_POST) statement.
Output is:
Array
(
[cmd] => submit
[field0] =>
[field15] =>
[field1] => Array
(
[0] => option0
[1] => option1
[2] => option2
)
[field3] =>
[field4] => option0
[field7] =>
[field8] =>
[field11] =>
[field12] =>
[field14] =>
[field16] =>
[field17] => <br />
[field18] =>
[recaptcha_challenge_field] =>
02B_JVQ7mkZhsEo5WVRd6Czk1I1oT-4jBsP-i1VY2YzO3ckyuO-EJyox8VgDBmlk08MIFpzB_YyLfehv
dZyOzZOZvRoOcXz_PTjd4KuqCU2uTQfdmc-Vw0S4jSIoxoXQ8Cdzu2I55_xC_6-cXD_AbDcIQuL7MkSI
y64Tzje82Jv9GnVHrmbLznqw0kbAWB2NF0jQz7dmdvpEVElDwhpFBGDy5MhWFvW36w81qwkNB7vrmCLo
gvTXWAiRL-WUZiuV8dp2P8xN-PEsSfyW6NrvFim1Gis2YB
[recaptcha_response_field] =>
)
The File Vars:
^ as you can see, there is nothing to see :-)
What am I doing wrong?
Do you have an working example for me please?
Thanks in advance!
Ralf
Original comment by [email protected]
on 13 Mar 2010 at 7:46
from php-form-builder-class.
Ralf,
Kind greetings to you from the US :) In the code you provided above, I see you
are
doing...
print_r($_FILE);
You need to change this to...
print_r($_FILES);
php.net is a great site for all things php related. Check out
http://us2.php.net/manual/en/features.file-upload.post-method.php for more
information and instruction on how file uploads are handled in php.
Thanks,
Andrew
Original comment by [email protected]
on 13 Mar 2010 at 7:57
from php-form-builder-class.
Hi.
>In the code you provided above, I see
>you are
>doing...
>print_r($_FILE);
>You need to change this to...
>print_r($_FILES);
Argl!! OK I'am stupid.
Sorry for the hassle!
But to mention the $_FILE thing in the examples would help a lot.
Thanks for the help and keep up the good work, the form_class is really
helpful!
Ralf
Original comment by [email protected]
on 13 Mar 2010 at 8:19
from php-form-builder-class.
Related Issues (20)
- Default value for a radio button HOT 2
- add custom ajax
- Submitting Obejcts as JSON strings instead of traditional POST
- Error Submit Ajax form
- Form Builder Class Submit Button - No Value HOT 8
- Multiple Select - Multiple values not showing as pre-selected HOT 1
- Update to Bootstrap 3 HOT 4
- Doesn't update if Google Spreadsheet Column Name is a Number
- send and receive data to-from mysql db
- javascript load multiple times in pfbc(PHP Form Builder Class - Imavex) HOT 1
- Element Select and text value
- Radio buttons HOT 2
- Bootstrap 3 support
- Nginx ajax file upload error HOT 1
- How to add selected="selected" on Select with PFBC 3.1? HOT 3
- How to compare two elements's values (e.g. password / password new)
- How to compare user entered element value with DB content?
- accentuation on the placeholder
- Custom CSS
- Having a multiple default in a Multiple Select
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-form-builder-class.