Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

HTML inside PHP Question

Hi everyone,

I want to change the colour of this text displayed.

	echo "<h1>Successfully added!</h1><br><br>";

Open in new window


Please can someone tell me how to do this.

Thanks,

Derek
0
TLN_CANADA
Asked:
TLN_CANADA
  • 2
  • 2
1 Solution
 
Robert SchuttSoftware EngineerCommented:
you can use a class, or an inline style
<h1 style="color: green;">

Open in new window

0
 
TLN_CANADAAuthor Commented:
Here is what I've tried but it doesn't work :

      echo "<h1 style="color: green;">Successfully added!</h1><br><br>";

It's a phpfox script so sometimes it is very particular about the syntax. Could you suggest another method of doing this?

Thanks for your help,

D
0
 
Robert SchuttSoftware EngineerCommented:
that's because of the quotes. you have to escape or alternate with single quotes.
echo "<h1 style='color: green;'>Successfully added!</h1><br><br>";

Open in new window

0
 
Ray PaseurCommented:
it doesn't work
As far as I can recall there is no such error message from PHP!  

No points for this, please -- robert_schutt has given you the correct answer.  But going forward, please follow the guidance of the SSCCE when you post questions.  It will make for quicker, more accurate answers.  In PHP, that means raising the error reporting level and the display errors level, and then showing us the exact error message and the exact line number of the error message.  In the instant case you probably got a "Parse error" and knowing that information leads us to better answers more quickly.
0
 
TLN_CANADAAuthor Commented:
Thank you Ray, I will be sure to post this in the future.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now