Search the Community
Showing results for tags 'echo'.
-
Hey there! I want to style an "echo" in PHP. ( You know. Make it blue, position it, ect. ) All the examples and places I have learned about this work, but this echo has a variable in it: echo '<div id="welcome_username">"Welcome, " . $myusername . "!"</div>'; The variable is $myusername ( Making it say "Welcome, Username!" =P ) Is there a different way to style an echo, when it has a variable? Thanks for your time. ~ Spencer ( If you must, here is the whole code... I do't think it is needed though. ) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <?php session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } $myusername = $_SESSION['myusername']; ?> <html> <head> <title>Mbox:homepage</title> <script> window.setInterval(function(){ window.scrollTo(40, 220); }, 50); </script> <style> /*3DS SCREEN START*/ div#topscreen { position: absolute; top: 0px; left: 0px; height: 218px; width: 320px; background-color:#E0FFFF; z-index:2; } div#bottomscreen { position: absolute; top: 218px; left: 0px; height: 212px; width: 320px; background-color:#E0FFFF; } /*3DS SCREEN STOP*/ /* WELCOME USERNAME STYLE START */ div#welcome_username { color:#0000EE; font-weight: bold; position:absolute; top:5px; left:50px; } /* WELCOME USERNAME STYLE STOP */ </style> <meta name="viewport" content="width=320"> </head> <body> <!-- TOP SCREEN --> <div id="topscreen"> <?php echo '<div id="welcome_username">Welcome, . $myusername . !</div>'; ?> <p style="color:red; text-decoration:underline;">Homepage under construction.</p> </div id="topscreen"> <!-- BOTTOM SCREEN --> <div id="bottomscreen"> </div id="bottomscreen>" </body> </html>