Reply to Re: How do you test for blank form input?

Your name:

Reply:


Posted by Smitro on 08/18/05 11:05

Chris Portka wrote:
> This is a very simple question but after a long time I still can't find
> an answer looking on my own. How do you test for no user input in a
> form? Example:
>
> <form action="index.php" method="get">
> Type your first name:
> <input type="text" name="FirstName">
> <input type="submit" value="Submit">
> </form>
>
> <?php
> if ($_GET["FirstName"] == "")
> {
> echo "No user input";
> }
> ?>
>
> Is this the correct way to always test if there was nothing input by
> the user in the form? Should I test for nil or something else?
> Thanks,
> Chris
>
I also use NULL some times...eg.
if ($_GET["FirstName"] == NULL)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация