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 6808433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:57:17+00:00 2026-05-26T19:57:17+00:00

I have an error_codes.php file located in application/libraries I have it autoloaded when CodeIgniter

  • 0

I have an error_codes.php file located in application/libraries I have it autoloaded when CodeIgniter loads but the variables are not recognized in the controllers. I get an undefined variable when loading the page. Am I loading the files wrong or do I have the variables wrong. I have tried it wihtout the static but no luck.

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class error_codes {

    static $a200 = array('error' => 'NO', 'code' => '200', 'description' => 'none', 'message' => 'Request ok');
    static $a206 = array('error' => 'YES', 'code' => '206', 'description' => 'Partial Content', 'message' => 'Not enough location data!');
//    
    static $a400 = array('error' => 'YES', 'code' => '400', 'description' => 'Bad Request', 'message' => 'This is not a valid URL');
    static $a401 = array('error' => 'YES', 'code' => '401', 'description' => 'Unauthorized', 'message' => 'Did you provide valid API key?');
    static $a402 = array('error' => 'YES', 'code' => '402', 'description' => 'Username Exists', 'message' => 'Username already exists!');
    static $a403 = array('error' => 'YES', 'code' => '403', 'description' => 'No User Exists', 'message' => 'User does not exists!');
    static $a404 = array('error' => 'YES', 'code' => '404', 'description' => 'Invalid Parameters', 'message' => 'Not enough user parameters!');
    static $a406 = array('error' => 'YES', 'code' => '406', 'description' => 'Invalid Email', 'message' => 'Email is invalid!');

}

?>
  • 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-26T19:57:18+00:00Added an answer on May 26, 2026 at 7:57 pm

    You can not use static variables this way. Convert them to public vars, this might do what you want.

    Additionally run your code with a step-debugger and see if your file gets included.

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

Sidebar

Related Questions

I have a PHP script that uses cURL to access a file also located
Basically I have a php script located on a sever that generates a JSON
I have a folder which php uploads to located in the directory above www
I have an error.php file which can be grossly simplified to: <? if (!isset($error))
I have a problem. When I use global variables in my php code, my
I have an error.php file attached to ErrorHandler that will take the error HTTP
Php noob. I have this text file (names.txt) with comma separated names and codes.
I have a class file: class_xx.php. And then a function file: function_xxx.php In my
I have this deploy.rb file: set :application, UDA set :domain, 10.0.0.59 set :deploy_to, /home/gitek/www/uda/
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,

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.