Solved

Centering An Error Message

Posted on 2015-01-18
3
85 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
Comment Utility
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
Comment Utility
Thank you.  Worked great!
0
 
LVL 17

Expert Comment

by:bigeven2002
Comment Utility
Glad I could help!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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