Issue Solved: CodeIgniter Use of undefined constant VIEWPATH


Use of undefined constant VIEWPATH issue occurs when you upgrade your existing CodeIgniter application version to CodeIgniter 3.x. The undefined constant viewpath issue can be easily solved by the following solution. Open the root’s index.php file and specify the view directory to solve this issue.


How to Remove index.php from URL in CodeIgniter


CodeIgniter uses the segment-based approach to design URLs human-friendly or seo-friendly. By default, the index.php file will be included with the URLs in CodeIgniter. But you can easily remove the index.php from the URL using .htaccess.


How to change the timezone in CodeIgniter


PHP date_default_timezone_set() function is used to sets the default timezone used by all date or time functions. In CodeIgniter, the best place to set the timezone is index.php file of application root. Place the date_default_timezone_set() with your desired timezone in the main index.php file of your application.


How to insert UUID in CodeIgniter


Universal Unique Identifier (UUID) in MySQL is used as row identity value (PRIMARY KEY). If you are working with CodeIgniter and want to insert UUID as row PRIMARY KEY, use this sample code to insert UUID as PRIMARY KEY into MySQL table in CodeIgniter.


How do you upload doc and docx files in CodeIgniter


Are you getting filetype is not allowed error? At the time of uploading doc or docx files with CodeIgniter upload library. You can easily fix this error by modifying mimes.php file in CodeIgniter. Change doc and docx mime types for solve the CodeIgniter doc and docx upload problem.