Solved

Centering An Error Message

Posted on 2015-01-18
3
87 Views
Last Modified: 2015-01-19
I have an error message that pops up.  However, I can't figure out how to center it.

if(trim($name) == '') {
			$error = '<div class="error_message">Attention! You must enter your name.</div>';
		} else if(trim($email) == '') {
			$error = '<div class="error_message">Attention! Please enter a valid email address.</div>';

		} else if(!isEmail($email)) {
			$error = '<div class="error_message">Attention! You have enter an invalid e-mail address, try again.</div>';
		
		} else if(trim($comments) == '') {
			$error = '<div class="error_message">Attention! Please enter a comment.</div>';
		
		} else if(trim($verify) == '') {
			$error = '<div class="error_message">Attention! Please enter the verification number.</div>';
		
		} else if(trim($verify) != '4') {
			$error = '<div class="error_message">Attention! The verification number you entered is incorrect.</div>';
		}

		if($error == '') {

			if(get_magic_quotes_gpc()) {
				$comments = stripslashes($comments);
			}

Open in new window


The Link.
http://davidschure.com/hello.php

I can't find "error_message" class either to make the text red.
0
Comment
Question by:DS928
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
bigeven2002 earned 500 total points
ID: 40556896
Hello,
From the looks of the source on the site, the error_message class doesn't exist.  Try adding it in the styles.css or nav_styles.css file.
div.error_message {
text-align:center;
color:red;
}

Open in new window

0
 

Author Closing Comment

by:DS928
ID: 40557028
Thank you.  Worked great!
0
 
LVL 17

Expert Comment

by:bigeven2002
ID: 40557291
Glad I could help!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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…

786 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