Solved

Can you change the text/font of PHP output messages and errors such as to white, on a black site?

Posted on 2008-06-24
6
197 Views
Last Modified: 2008-06-25
Hello

Is it possible to change the text style of messages from PHP and maybe MySQL while I'm asking?

My website background is black so obviously I cant see any appear I have been pressing CTRL+A on the page for the last 2 weeks lol  Also the messages show behind elements on my site so I need to CTRL+C and then CTRL+P into notepad lol

Its a bit much work to read it. This is one of those questions I bet I should know, something obvious! but then that happens to me sadly!!!

Thanks anyone
0
Comment
Question by:Ryan Bayne
6 Comments
 
LVL 14

Accepted Solution

by:
Tchuki earned 125 total points
ID: 21860033
<style type="text/css">
body{
font-color: #FFF;
}
</style>
0
 
LVL 2

Author Comment

by:Ryan Bayne
ID: 21860085
Aw I tried to delete this question too late lol

It hit me after it you can encapsulate a block of PHP so that its output is styled. Just setting the body font-color never popped up though.

thanks bud
0
 
LVL 5

Expert Comment

by:codeQuantum
ID: 21860158
There is an easier way than encapsulating the whole php code or changing the whole page style...

Take the MySQL errors for examples. Wrap them in a CSS definition, and style it. Have a look at the code and tell me if it is clear :


// your MySQL query	

$result = mysql_query($query, $conn);

// we capture the error message and style it

if (!$result) errorDie('<h2 class="error">Invalid query: '.mysql_error()."\nWhole query: ".$query."</h2>"); //debug

Open in new window

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 14

Expert Comment

by:agriesser
ID: 21860202
There are configuration options in php.ini to make this work:

; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"

; String to output after an error message.
;error_append_string = "</font>"
0
 
LVL 5

Expert Comment

by:codeQuantum
ID: 21860213
wow I didnt know that. Thanks agriesser.
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21860255
You're welcome :) That's what EE is for - never stop learning ;)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

22 Experts available now in Live!

Get 1:1 Help Now