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

  • SEARCH
  • Home
  • 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 9057767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:32:40+00:00 2026-06-16T14:32:40+00:00

It is frustrating to get error reports from users via email. I bet that

  • 0

It is frustrating to get error reports from users via email. I bet that most users wouldn’t send a bug report to developer. Therefore, I wanna set up that if the user get PHP error codes, I would like to get the error reports automatically via email.

Is there a way to get user error reports in PHP or CodeIgniter?

Thank you.

  • 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-06-16T14:32:41+00:00Added an answer on June 16, 2026 at 2:32 pm

    You can do something like this:

    <?php  
    // Our custom error handler  
    function email_error_handler($number, $message, $file, $line, $vars)  
    {  
        $email = " 
            <p>An error ($number) occurred on line 
            <strong>$line</strong> and in the <strong>file: $file.</strong> 
            <p> $message </p>";  
        $email .= "<pre>" . print_r($vars, 1) . "</pre>";  
        $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";  
        // Email the error to someone...  
        error_log($email, 1, 'you@youremail.com', $headers);  
        // Make sure that you decide how to respond to errors (on the user's side)  
        // Either echo an error message, or kill the entire project. Up to you...  
        // The code below ensures that we only "die" if the error was more than  
        // just a NOTICE.  
        if ( ($number !== E_NOTICE) && ($number < 2048) ) {  
            die("There was an error. Please try again later.");  
        }  
    }  
    // We should use our custom function to handle errors.  
    set_error_handler('email_error_handler'); 
    // Trigger an error... (var doesn't exist)  
    echo $somevarthatdoesnotexist;  
    

    Source

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really frustrating error that I've spent hours looking at and cannot
I am getting an extremely frustrating error from the compiler in one of my
I'm getting a really frustrating error that I've been struggling with for some time
I am trying to get column info from a cursor, and getting a frustrating
My God, EF is so frustrating. I can't seem to be able to get
One frustrating behavior in vim is that when i move my cursor right or
this is frustrating... I keep getting an error with my ftp_put: This the error:
When I try to run my ASP.NET app from my development environment I get
Something is wrong and it is very frustrating. I read on velocity's homepage that
I am working on a PHP script locally that has a bug in it

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.