Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6384273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:45:21+00:00 2026-05-25T02:45:21+00:00

When PHP encounters an error, it displays the Error or Warning message in a

  • 0

When PHP encounters an error, it displays the Error or Warning message in a div with some inline style. I wish to add a class="some-class" or id="some-id" attribute to the div so that I can do a little styling in my CSS file. Is that possible and how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:45:22+00:00Added an answer on May 25, 2026 at 2:45 am

    Never use an ID twice in the same page. PHP errors are printed en masse, so use a class instead. Find the following two lines in your php.ini file (on my Ubuntu box, it’s in /etc/php5/apache2/php.ini:

    error_prepend_string
    error_append_string
    

    And change them to suit your needs. I use inline styles with them so I don’t have to add anything into my stylesheet, but you could of course add a class. This is my setup:

    error_prepend_string = "<div style='font-weight: bold; color: red'>Error: "
    error_append_string = "</div>"
    

    Yours might be something like this:

    error_prepend_string = "<div class='phpError'>Error: "
    error_append_string = "</div>"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a PHP library that throws various custom Exceptions when it encounters errors.
I've run across an interesting PHP/SOAP error that has me stymied. After searching I
We're currently running with php 5.2.5. We have now encountered a bug that creates
PHP's explode function returns an array of strings split on some provided substring. It
I have been trying to output XML with PHP but encountered a strange(!) error
I am using this code to insert some values in MySql table: <?php mysql_connect(localhost,root,root);
This is probably obvious but I'm getting this error: A PHP Error was encountered
I have encountered an error: Warning: mail() [function.mail]: Failed to connect to mailserver at
I'm all of a sudden getting the following error on a site that I've
Model : <?php class Blogm extends CI_Model{ function __construct() { // Call the Model

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.