What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?


I am trying to insert some php code to my WordPress website but it gives security warnings perhaps due to directly accessing $_POST variable.

Instead of $name = $_POST['name'];, I can use $name = filter_input(INPUT_POST, 'name'); however I am not able to figure out what alternative piece of code I should use instead of if(isset($_POST) && !empty($_POST)) { //some code }?

Thanks for your help in advance.

Asmat Ali 1 month 0 Answers 9 views 0

Leave an answer