PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I check for an empty field in a form?


If you want to check whether a form field has a value or not, use the empty function

<?php
$formvalue 
"on";
if(empty(
$formvalue)) { echo "I am empty!"; }
?>


People sometimes get confused between isset and empty - the former just checks whether the variable is present or not but ignores any value it may or may not have.



ASK A QUESTION

More forms PHP Questions

I have a form that I need to do two things: send all the input values to a confirmation/pay page, and send to me via email. Payment is based on what the customer picks (naturally). The way I have it set up is the form action goes to the confirmat

How can I access information sent through POST on a form?

how to i decimal, comma, and $ format a number called from mysql displayed in a table cell using php. This is the call script and this is the formatting script How do I replace the $value=123... with my call script? Thanks

how to avoid the refresh or goback to submit the post values in database

I am having a form. Here, i am submitting the form using java script as its necessary. If the form method is get, i am able to get in redirection page and can get the hidden values in the form. But if the form method is post, i am not able to get those hi



Custom Search