Solved

HTML inside PHP Question

Posted on 2013-01-19
5
184 Views
Last Modified: 2013-01-20
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
Comment
Question by:TLN_CANADA
  • 2
  • 2
5 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38795983
you can use a class, or an inline style
<h1 style="color: green;">

Open in new window

0
 

Author Comment

by:TLN_CANADA
ID: 38795999
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
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38796159
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
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 38796400
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
 

Author Comment

by:TLN_CANADA
ID: 38797920
Thank you Ray, I will be sure to post this in the future.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question