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
199 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:
Vel Eous 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

10 Experts available now in Live!

Get 1:1 Help Now