# Flash receives variable from php, but cant compare it!

**URL:** <https://forum.kirupa.com/t/flash-receives-variable-from-php-but-cant-compare-it/46193>\
**Category:** Uncategorized\
**Created:** [March 22, 2004, 2:19pm UTC](https://forum.kirupa.com/t/flash-receives-variable-from-php-but-cant-compare-it/46193 "2004-03-22T14:19:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hga77](https://avatars.discourse-cdn.com/v4/letter/h/4bbf92/32.png) [@hga77](https://forum.kirupa.com/u/hga77)\
**Post date:** [March 22, 2004, 2:19pm UTC](https://forum.kirupa.com/t/flash-receives-variable-from-php-but-cant-compare-it/46193/1 "2004-03-22T14:19:13Z")

</div>

hi…Im using php to check for existance of username. It send back to flash ‘false’ if user already exist, and ‘true’ if user does not exist.

php:

```php
if ($num > 0)//loginName already exists
{
	echo "auth=false";
}
else//loginName does not exist, so we can insert this user
{
	echo "auth=true";
}

```

This php works and sends the correct value (true or false).

AS:  
[AS]loadInfo = new LoadVars();  
added= “Begin Login Process - Please Wait…”;  
loadInfo.onLoad = function(success){  
if (success)  
{  
errorRegion=this.auth;//this outputs correctly  
if (this.auth == ‘false’)//but this wont check!  
{  
added= “”;  
errorUser=“Username already exists.”;  
}  
else if (this.auth == ‘true’)//and this wont check!  
{  
added=“You have been added”;  
}  
}  
else  
{  
added=“could not load in stuff!”;  
}  
};  
user.sendAndLoad(“userRegistration.php”, loadInfo, “POST”);[/AS]

The ‘if’ statements wont run…its like flash cant recognize what it has already recieved! why?

Can some1 take the time to check whats wrong ! thanks
