In this question, you will be evaluated on your knowledge about forms ..." /> Suppose We Receive A Form Submitted By A Post To Subscribe To A Newsletter. This Form Has Only One Field, An Input Text Field Named Email. How Would We Validate Whether The Field Is Empty? Print A Message "The Email Cannot Be Empty" In This Case? In this question, you will be evaluated on your knowledge about forms ..." /> In this question, you will be evaluated on your knowledge about forms ..." />
Answers

Question and Answer:

  Home  PHP Community Marketing Expert

⟩ Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "The email cannot be empty" in this case?

<?php

if(empty($_POST['email'])){

echo "The email cannot be empty";

}

?>

In this question, you will be evaluated on your knowledge about forms management and validation. There is not unique answer for this question, but it must be similar to this one.

 191 views

More Questions for you: