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
198 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
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.

919 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

15 Experts available now in Live!

Get 1:1 Help Now