When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags as they make your code much easier to read and analyze.
As for your question... how is it supposed to "work" ? You've simply shown us a code snippet that defines a variable without describing what the problem is.
One issue I see is the user_name value is equal to a period, followed by the value of the variable $username, followed by a period. Assuming that's an attempt at concatenating the value of the variable named $username, then I'd say you're either missing double quotes to end and start the string pieces you're wanting to join together, or else you shouldn't do concatenation at all and simply use variable interpolation within a double quote delimited string. See the manual page for [man]string[/man] for more info.