Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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?

Answer Posted / Uttam Kumar Singh

In PHP, you can use the $_POST superglobal array to access the submitted data. To check if the 'email' field is empty, you can use the empty() function: if(empty($_POST['email'])) { echo "the email cannot be empty"; }

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List some features of php that are deprecated in php7?

1008


What is the current stable version of php?

1097


What does $_files means?

1143


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1970


What sized websites have you worked on in the past?

1065


What is the difference between htmlentities() and htmlspecialchars()?

1072


sort term descripttion form, report and uery

2249


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2146


how to detect a mobile device using php

1160


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1059


What is trait in php?

1051


Explain me is it possible to destroy a cookie?

1006


Tell me what kind of things have you done on the social side?

1051


How to create a web form?

1091


Write a program using while loop?

1097