<?php error_reporting(-1); header('Content-Type: text/html; charset=utf-8'); ini_set('display_errors', 'On'); if(isset($_POST['email']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)){ echo 'Всё ок!'; } ?> <form action="" method "post"> <input type="text" name="email"> <input type="submit"> </form> 

Nothing is displayed, I have already facilitated, removed, what comes after && and everything does not work early, why I do not always have such simple things working?

  • Did you press a button? Inspect the post request itself in the browser (F12 - Network). - vp_arth
  • pressed many times - DivMan
  • If everything is fine with the request - read the logs - vp_arth
  • data is transferred to url, and echo does not work - DivMan
  • All, I saw) Second - vp_arth

2 answers 2

You incorrectly specified the form method attribute:

 <form action="" method="post"> <input type="text" name="email"> <input type="submit"> </form> 

And by default, the form sends data by the get method, and in php it was necessary to search for it in $_GET .

    You just do not have enough mark equal ...

    method = "post" ... helps a lot to dump the code:

     var_dump($_POST['email']); die(); 

    enter image description here