# Php/Flash adding a space at the end of my variable, driving me crazy!

**URL:** <https://forum.kirupa.com/t/php-flash-adding-a-space-at-the-end-of-my-variable-driving-me-crazy/188069>\
**Category:** programming\
**Created:** [May 4, 2006, 10:45am UTC](https://forum.kirupa.com/t/php-flash-adding-a-space-at-the-end-of-my-variable-driving-me-crazy/188069 "2006-05-04T10:45:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [May 4, 2006, 10:45am UTC](https://forum.kirupa.com/t/php-flash-adding-a-space-at-the-end-of-my-variable-driving-me-crazy/188069/1 "2006-05-04T10:45:24Z")

</div>

Hi,

I am using a simple php file to pull data from a mysql database.

This is the code I use to echo the variable back to flash in php (ignore the space in username, kirupua doing that I think !):

_echo ‘returned\_password=’.$password.’&username=’.$username;_

This is what is I get if I view the php file output in a browser:

_returned\_password=dev&username=dev_

There is no space at the end of the username (if you highlight it).

Now in flash I am using a simple LoadVars and sendAndLoad to get this information.

This is what I get when I trace out the returned variable (username):

\*The returned Username is :devstar \*

If you highlight the above you can see there is a space at the end.

These are the other importants bits of code:  
\*  
var returned\_login\_lv:LoadVars = new LoadVars();\*

_envelope\_login\_lv.sendAndLoad(“[http://www.mydomain.com/password.php](http://www.mydomain.com/password.php)”,returned\_login\_lv, “GET”);_

_trace(returned\_login\_lv.username);_

The returned password has no space at the end? The problem is I want to user the username variable for comparisons but the space messess these up! I know I could delete the last character, but I want to know why it isn’t working.

Any help would be great.

Thanks.

Dev
