Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Centering An Error Message

Posted on 2015-01-18
3
88 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn how to count occurrences of each item in an array.

808 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