Giter Site home page Giter Site logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.