php help

i made a echo that echos the username of the user that logged in echo $Username;
and i was wondering how i could move the Username from the top left of the page to a different position.

did i not answer this question in another post yesterday??

no i know how to make a variable i just want to know how to make the users username a different color

this is what i put
[php]

$Username = $_POST[‘username’];
if($submit==TRUE){
//Trying to color the $Username
echo’

Hello, <?php echo $Username?>
';
}
[/php]
and that doesnt work it just echo’s “Hello,” and not “Hello, test” (test being the users username)

You are already within the PHP tags. Remove the second php echo. If you leave your echo with opening and closing single quotes, you’ll have to escape them and concatenate the variable for it to interpolate.

Other option is to use opening and closing double quotes on your echo and then escape the double quotes in your HTML with a backlash

[php]echo ‘hello’. $variable .’ more text’;[/php]

Or

[php]echo “hello $variable more text <color =“red”>”; // Html not correct. Just an example.[/php]

As far as the text coloring, the code you are using is deprecated. You need to use a CSS class or the span tag

Thank you

Sponsor our Newsletter | Privacy Policy | Terms of Service