# PHP driving me up the wall.  What's wrong with this code?...

**URL:** https://boards.straightdope.com/t/php-driving-me-up-the-wall-whats-wrong-with-this-code/510497
**Category:** Factual Questions
**Created:** [September 17, 2009, 8:57pm UTC](https://boards.straightdope.com/t/php-driving-me-up-the-wall-whats-wrong-with-this-code/510497 "2009-09-17T20:57:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Lobsang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lobsang/32/4067_2.png) [@Lobsang](https://boards.straightdope.com/u/Lobsang)
#### Post date: [September 17, 2009, 8:57pm UTC](https://boards.straightdope.com/t/php-driving-me-up-the-wall-whats-wrong-with-this-code/510497/1 "2009-09-17T20:57:41Z")

</div>

This code…

```php

<form enctype="multipart/form-data" method="POST" action="<?=$_SERVER['PHP_SELF']?>" >
<input type="file" id="userfile" name="userfile">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="submit" name="submit">
</form>

```

If I display the contents of POST…

```php

echo "<pre>". print_r($_POST) . "</pre>";

```

I get this…

- 

Array  
(  
[MAX\_FILE\_SIZE] =\> 1000000  
[submit] =\> Submit Query  
)  
\*  
It’s like it’s not bothering to remember the contents of ‘userfile’.

What the hell is happening. I’m tearing my hair out. I’ve tried messing about with the code in all kinds of different ways. It just won’t remember the file name.

---

<div class="post-metadata">

### Author: ![Lobsang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lobsang/32/4067_2.png) [@Lobsang](https://boards.straightdope.com/u/Lobsang)
#### Post date: [September 17, 2009, 9:04pm UTC](https://boards.straightdope.com/t/php-driving-me-up-the-wall-whats-wrong-with-this-code/510497/2 "2009-09-17T21:04:43Z")

</div>

Disregard. Apparently the filename doesn’t go in POST, it goes somewhere else.

I thought it wasn’t working because elsewhere I was checking isset(\_POST['userfile']) when I should have been checking isset(\_POST[‘submit’])
