Testing for NULL

From: Date: Mon, 18 Mar 2002 19:09:06 +0000
Subject: Testing for NULL
Groups: php.general 
Request: Send a blank email to php-general+get-88988@lists.php.net to get a copy of this message
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 **

« previous php.general (#88988) next »