You are here: Re: if statement « PHP Programming Language « IT news, forums, messages
Re: if statement

Posted by Gordon Burditt on 11/06/06 05:07

>I am trying to remember how you write an if statement to check if any value
>has been entered. For example seeing if a username has been entered in form.

The variable $_GET['username'] or $_POST['username'] is where the
input from a form element appears in a modern version of PHP, not $username.

>I have seen the following:
>
>if ($username == '')
>{
> print ("You've pressed submit without entering your username");
>}
>
>However is there another method which uses an exclamation mark? I am sure I
>have seen something for where $username has no value but I can't think what
>it was.

You can use isset($_GET['username']) to determine if the value was given
at all.

 

Navigation:

[Reply to this 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

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