Posted by Lisa Pearlson on 08/18/05 10:34
trim() and also look at empty()
"Chris Portka" <chrisportka@gmail.com> wrote in message
news:1124330068.912666.7920@g43g2000cwa.googlegroups.com...
> 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
>
[Back to original message]
|