Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599276
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599416
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599420
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.