Question: I have form for example:

```
<input type="text" />

<input type="file" />

<input type="submit" />

```

You have to fill the text and the file, if you dont fill the text for example you have an error message, but I want to preserve what the user filled in the file's input.
How to do it with `$_POST` or somthing else?

Answer: 
> 
> I want to preserve what the user filled in the file's input.
> 
> 
> 

Impossible.
whatever user submits from client-side is not controlled by server-side, but you can:

* use javascript to "scan" the extension name of file (.php), and prevent other files from not being able to be submitted. However this doesn't stop people renaming other files to .php.
* the question is what you gonna do with the submitted php file? keep it in database? or execute it? you need to scan its content to make sure it doesn't contain malicious code. I am not very sure how php can do this, though.