#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    51
    Rep Power
    6

    Text color question


    Hi,


    Am trying to add color to text in the line below...I simply just don't know how to do it.
    I hope someone can help. I'd really appreciate it!

    PHP Code:

     
    else if (!empty ($errors_messages)) {
            
    $errors "<p style="color:red"><b><>" $txt['errors'] . "</b><br>" $errors_messages "</p>";
        } 
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,692
    Rep Power
    6351
    PHP Code:
    else if (!empty ($errors_messages)) { 
            
    $errors "<p style='color:red'><b><>" $txt['errors'] . "</b><br>" $errors_messages "</p>"
        } 
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    51
    Rep Power
    6
    Originally Posted by ManiacDan
    PHP Code:
    else if (!empty ($errors_messages)) { 
            
    $errors "<p style='color:red'><b><>" $txt['errors'] . "</b><br>" $errors_messages "</p>"
        } 
    THANKS, ManiacDan!!

    single quotes, instead of double....ugh...
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,300
    Rep Power
    7170
    The problem isn't specifically that you used double quotes instead of single quotes, the problem is that you tried to put double quotes into a string that was delimited by double quotes, and you didn't escape the double quotes that you wanted to be used as values instead of delimiters.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,692
    Rep Power
    6351
    Read the manual for more.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    51
    Rep Power
    6
    Originally Posted by E-Oreo
    The problem isn't specifically that you used double quotes instead of single quotes, the problem is that you tried to put double quotes into a string that was delimited by double quotes, and you didn't escape the double quotes that you wanted to be used as values instead of delimiters.

    I did escape the double quotes with the slashes \....but it didn't work, so I figured something else was wrong (maybe I repeatedly entered "/" this instead...also, I've used single quotes plenty of times to sidestep having to escape double quotes with slashes...why I didn't think of it this time? -->> Must be just one of those foggy mind days...

    I've spent days before trying to fix something...when it was just supposed to be "text" and not "txt"...good thing I'm in a self-tutoring phase and am not working for anyone.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    51
    Rep Power
    6
    Originally Posted by ManiacDan
    Read the manual for more.
    Thanks!
  14. #8
  15. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,692
    Rep Power
    6351
    / isn't special. \ is super special. Just keep that in mind.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    51
    Rep Power
    6
    Originally Posted by ManiacDan
    / isn't special. \ is super special. Just keep that in mind.
    That helps. Yup, will do.

IMN logo majestic logo threadwatch logo seochat tools logo