Re: Testing for NULL

From: Date: Mon, 18 Mar 2002 19:18:41 +0000
Subject: Re: Testing for NULL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88989@lists.php.net to get a copy of this message
if (!isset($login)){ echo "login undefined"; } Best regards, Andrey Hristov ----- Original Message ----- From: "Jesse Warden" <jwarden@theartifex.com> To: <php-general@lists.php.net> Sent: Monday, March 18, 2002 9:09 PM Subject: [PHP] Testing for NULL > Hi, I am new... hope I am using this list correctly. > > I am trying to test for a null value, and if it is null, then to use a > default value instead. The login page that I have, I want to show nothing > in the username field unless it is passed a username from another PHP page > via the header function. However, every time I write: > > if($username == null){ > echo "Username is null"; > } > > It executes the echo, but only after giving me an error. Is there a way to > suppress this error or check for an undefined instead? > > J > > > ** Scanned for Viruses ** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#88989) next »