Pavlos1316 Posted July 25, 2008 Share Posted July 25, 2008 Hi all.. I was given this code to display a msg the first time a user logs in. <?php if (!$_SESSION['firsttime']) { echo "<center><font size=10><font color=#00FFFF><font weight=bold>Welcome</font></font></font></center>"; $_SESSION['firsttime'] = true; } ?> Everything is working exept the <font size>. What ever I do is not changing. Any ideas why? Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/ Share on other sites More sharing options...
MasterACE14 Posted July 25, 2008 Share Posted July 25, 2008 this isn't a PHP problem as such. However.... Try this: <?php if (!$_SESSION['firsttime']) { echo <<<_WELCOME <center><font size="10" color="#00FFFF" weight="bold>Welcome</font></center> _WELCOME; $_SESSION['firsttime'] = true; } ?> Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599276 Share on other sites More sharing options...
abhikerl Posted July 25, 2008 Share Posted July 25, 2008 Instead of using simply html, you can used css. This can help later if you need any changes to make. Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599283 Share on other sites More sharing options...
DeanWhitehouse Posted July 25, 2008 Share Posted July 25, 2008 or another option <?php if (!$_SESSION['firsttime']) { echo "<center><font size='10' color='#00FFFF' weight='bold'>Welcome</font></center>"; $_SESSION['firsttime'] = true; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599405 Share on other sites More sharing options...
LemonInflux Posted July 25, 2008 Share Posted July 25, 2008 if (!$_SESSION['firsttime']) { echo "<span style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</span>"; $_SESSION['firsttime'] = true; } ---------------- Now playing: Red Hot Chili Peppers - I Like Dirt via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599416 Share on other sites More sharing options...
MFHJoe Posted July 25, 2008 Share Posted July 25, 2008 if (!$_SESSION['firsttime']) { echo "<span style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</span>"; $_SESSION['firsttime'] = true; } <span> won't let you center the text because it's not a block element. Using <div> would work though: if (!$_SESSION['firsttime']) { echo "<div style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</div>"; $_SESSION['firsttime'] = true; } Just saving another question if Pavlos decides to use this way. Quote Link to comment https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599420 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.