Display $_FILES[]

I have a simple form

And am trying to get the $_Files to be output, but this happens (I can get the $_POST variable to be seen but why not the $_FILES one?)


Heres the code,

echo '<table class="table table-bordered">';
echo '<tr><th colspan="2">FILES VARIABLES</th></tr>';

    foreach ($_FILES as $key => $value) {
        echo "<tr>";
        echo "<td>";
        echo $key;
        echo "</td>";
        echo "<td>";
        echo $value;
        echo "</td>";
        echo "</tr>";
    }

echo '</table>';

Did you check to see if $_Files[] was empty or not?

Iā€™m not that familiar with using the $_FILES array, but what data are you trying to extract from it?
Maybe you should be using the sub-array $_FILES['userfile']

1 Like

print_r($_FILES); ?

1 Like

ok, the print_r thing worked , but how can I get inn a nice format?

Try enclosing print_r(...); within echo "<pre>";and echo "</pre>";

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.