Solved

HTML inside PHP Question

Posted on 2013-01-19
5
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to dynamically set the form action using jQuery.

617 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