Yesterday, literally everything worked, and today, with minor changes, not a damn thing works.

<form method="POST" action="test.php"> <input type="file" name="file"/> <input type="submit" value="test post"/> </form> 

php

 echo $_FILES['file']['name']; 

writes a warning!

Notice: Undefined index: file in test.php on line 2

Is it alright yes? I do not understand what is wrong, maybe the server lags, what else can be crazy I will not put

Closed due to the fact that off-topic participants are Visman , Mirdin , αλεχολυτ , aleksandr barakin , Dmitriy Simushev 25 Sep '16 at 20:23 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Visman, Mirdin, αλεχολυτ, aleksandr barakin, Dmitriy Simushev
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • var_dump($_FILES); - Visman
  • 3
    The form enctype is missing. - Minor
  • @ Small Thank you so much !!! completely out of my head flew - Vladimir Alexandrov

1 answer 1

In the <form > add the parameter enctype="multipart/form-data" Read