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

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

Can I use a variable from a .php file to give a value to an HTML FormMail form field thus: ? Thank you

How do I escape data that is going into a database?

How do you email the contents of a form to someone?

Hi all , I use CURL to login to webtrafficagents.com . I got the script and modified it to login to several sites , but it can't login to this one , any experts can help , a reward is granted :) what i want : I want to be able to view the source



Custom Search