Solved

HTML inside PHP Question

Posted on 2013-01-19
5
178 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 108

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now