Questions tagged [codeigniter]

CodeIgniter is a powerful web development framework specifically designed for PHP users. Developed by EllisLab and nurtured by BCIT, it has now become a prominent project sponsored by the CodeIgniter Foundation. Employing an enhanced version of the Model-View-Controller (MVC) design pattern, this toolkit provides developers with numerous classes, methods, functions, and syntax to facilitate seamless web application development. Notably, CodeIgniter offers two significant versions: 3.x and 4.x, each catering to distinct system requirements.

Error 403 with Firefox on Font Loading for CodeIgniter Website

Utilizing font-face in CSS to integrate custom fonts onto a web application being developed with CodeIgniter. This is the CSS code: @font-face { font-family: 'UniversLT-UltraCondensed'; src: url('../Fonts/LTUnivers/universlt59ultracondensed.eot'); ...

The form data submitted by jQuery is inaccurate

I am currently facing an issue with my jQuery implementation. I have a jQuery UI dialog containing a form, which is submitted using the ajax function of jQuery. The problem arises when I try to edit certain fields within a table using the same dialog. Aft ...

Issue with Angular2 not able to call POST method in CodeIgniter RESTful API resulting in 404 error

I am encountering an issue with my codeigniter restful API. While the GET method is working fine, I am unable to get the POST method to work from Angular2. this.api.post('quality/addeditquality', this.formdata).subscribe(data => { console.l ...

When attempting to upload multiple files in CodeIgniter, the function is_uploaded_file() is expecting a string as parameter 1, but an array

I am having trouble uploading multiple files. Below is my form code: <form method="POST" action="<?=base_url()?>register/saverecord" enctype="multipart/form-data"> <input type="file" name="file_upload[]" multiple="multiple" value= ...

Master the Art of Image Loading in Codeigniter

Hey there, I'm completely new to Codeigniter. In the Controllers folder, I've created a file called caller.php and in the Views directory, I've created a file named home1.php. Additionally, within the root directory, I've made an image folder labeled Ima ...

When utilizing the php base_url, I am unable to initiate a redirect to a different page using ajax

My aim is to utilize ajax in order to redirect to another page when a certain condition is met. However, I am facing difficulties when trying to achieve this using the php base_url. Strangely enough, if I use the direct path (http://localhost/CRH/......), ...

Verify if there are any time periods that fall within the specified start and end times

In my database, there are two fields named start_time and end_time. I need to check if a user-entered value falls within the time range specified by these two fields. If it is, then my function should return true; otherwise, false. I have attempted to wr ...

The process of uploading images functions without any issues with all devices, except for the

Issue with Image Uploading on iPhone Devices in PHP (CodeIgniter) The problem occurs when trying to upload images taken on iPhones, while non-captured or other images fail to upload. Here is a snippet of the code: <?php ..... ..... $thi ...

The Codeigniter application encountered an error due to an unidentified index in the database query

Having an issue with executing this query in CodeIgniter: Encountering an undefined index error for ->row['code']; This is the function causing the problem: public function getSExtension($id) { $temp = array(); $query = $this->db->query("S ...

Ways to send a specific row to an AJAX function within a Codeigniter view

Having just started using codeigniter, I am looking to transfer a row returned from the controller via the model to an ajax function within a view. The current code snippet below demonstrates how I am able to retrieve data from the model in the controlle ...

Cookie authentication in CodeIgniter with Angular HTTP requests in Ionic 3

I am experiencing difficulties sending POST/get requests to the server. When using the Postman Chrome extension, everything works fine. However, when attempting to use Angular Http (not HttpClient) in Ionic, I encounter errors. The first error is related t ...

The Codeigniter validation feature seems to be malfunctioning as it is causing the page to direct to a blank

Hello, I'm new to CodeIgniter and I have a question regarding the form validation in my view page. I have tried adding some code to activate the form_validator for the view but it seems to be redirecting the page to a blank page. Here is the code I added ...

Step-by-step guide on showcasing AJAX outcome within a table row

I am facing an issue with my AJAX process while trying to display the current value inserted in a new row of a table after successfully adding it to the database. I am unable to figure out how to echo or display the values. Immediate assistance is needed t ...

What is the best way to save information submitted through an AngularJS form into a database utilizing a CodeIgniter controller?

Currently working on a project using CodeIgniter, we are integrating PHP for the server side and AngularJS for the client side. The main goal is to store the name and ID of a User in our database. Below is the snippet of AngularJS code: <!doctype htm ...

Using CodeIgniter, input information into a textbox and verify if there is a corresponding record in the database when submitting

Working on a CodeIgniter project, I am faced with the task of adding information to a form within my view page called meal_add.php. Below is the form structure: <div id="content" class="box"> <form action="<?php echo base_url(); ?>index ...

Utilizing Codeigniter with TCPDF to Efficiently Load Multiple PDF Files

Current Problem: Issue with printing multiple PDFs when clicking on "Print PDF". Currently, only one PDF is generated. My Actions Taken: I have configured an array in the URI to loop 2 times using foreach. However, the problem persis ...

What is the Sequence of Array Elements?

My array was structured as follows: $data1 = array( 'first_name'=>$this->input->post('first_name'), 'last_name'=>$this->input->post('last_name'), 'company'=>$this->input->post('company'), ...

Exploring the significance of the static variable $_class declaration within the load_class function of CodeIgniter

While diving into the core features of CodeIgniter, I came across a query regarding the declaration of a variable. static $_classes = array(); As highlighted in this post, the purpose of this variable is to cache class objects. I'm confused because the ...

Unable to present the information due to a codeigniter error in retrieving the data

Encountering an issue where the data cannot be displayed and it's showing an error message of undefined variable: avg. Below is the script being used: The controller function: public function rate_config() { $rt = $_POST['hasil_rating']; ...

Determine using Javascript or jQuery whether the value of input1 is greater than the value of input2

Ensuring that Value1 is always greater than Value2 in a form submission is crucial. If Value1 becomes greater than or equal to Value2, an error message should be displayed and the form submission should not be processed. Below is the code for the form: & ...

Methods for passing JavaScript variables to PHP

I have encountered this problem on Stack Overflow before, but I couldn't find a solution that worked for me. I am using Codeigniter and have a form where users can rate a product. What I need to achieve is to insert the user's rating into the database when ...

Fatal error in CodeIgniter occurring while invoking CSS less functions

Whenever I try to execute this function, I encounter the following error message: "Fatal error: Uncaught exception 'Exception' with message 'load error: failed to find test.less' in C:\xampp\htdocs\project\applic ...

"The art of sending Ajax requests in combination with the powerful Code Ign

Struggling to send 2 values to my codeigniter controller has left me feeling defeated. Despite numerous attempts, I have been unsuccessful. The Controller requires the following inputs: $token = $this->input->post('cc_token'); $hash = $th ...

Deleting a database query once the modal is closed

When visiting the artist's about page on my website, clicking on the "button" will open a modal that retrieves information from a database. Currently, when you click on one artist button, close the modal, and then click on another artist, both artists ...

How can Codeigniter's template parsers produce PHP generated values?

After retrieving content from a database and getting a result_array(), the next step is to parse the view and insert tags into the HTML accordingly. However, one of the fields in the array is a datetime type field that needs formatting. Typically, using da ...

When I exit an Android app that is currently running a CodeIgniter web application within the Android mobile browser, the CodeIgniter session remains active and does not properly

Hello there, I am currently working on developing a Mobile App with CodeIgniter and PhoneGap/Cordova. My application is designed to open a local static HTML file in the android web browser, followed by using window.open to redirect to an external URL on t ...

Learn the process of utilizing AJAX to upload files in CodeIgniter

I have reviewed several solutions How to upload files using ajax in codeigniter File uploads in codeigniter through ajax but none seem to work with my specific code. I am trying to implement a feature where users can upload various types of files (such ...

When clicking on a dropdown option, the OnClick event does not seem

When selecting an option from the dropdown, it should retrieve a value from the database and display it in a text field. I implemented a click function which worked in Firefox but not in Google Chrome. HTML: <select id="classi" name="classi"> & ...

Add the array to the $data variable before passing it to the views

Currently, I am using CI and I have a specific method to load a CSS file in the constructor for every main page (e.g. contents) like this: $this->load->vars(array('add_css'=>array('contents'))); In my views, I check if the ad ...

Sending data to a method in a controller through an ajax request

I am struggling to find the answer, even though it may seem easy. The method in my controller is defined as follows: public function update_news($newsID = NULL) { //updates news article } I am attempting to use this method as the URL in an AJAX call. Fo ...

Guide on integrating a jQuery confirmation popup in CodeIgniter

Currently, I am working on a project independently and have chosen CodeIgniter as my framework. I am relatively new to PHP and CodeIgniter. I managed to create a confirm box in jQuery, but it displays as an HTML alert. Can someone guide me on how to improv ...

Show real-time server responses using jQuery while waiting for the AJAX request to complete

I have a challenge in creating a function that displays the server response while waiting for Ajax to complete. Here's the scenario: I have selected 10 checkboxes. When I click the submit button, Ajax is triggered. On the server side, there is a loo ...

Avoid Refreshing Form in Codeigniter

In order to avoid receiving the 'confirm form resubmission' warning, it is commonly advised to use GET method. However, in Codeigniter, the preferred method is often POST due to compatibility issues with form helper functions and other features. ...

Tips for iterating through data in JSON format and displaying it in a Codeigniter 4 view using foreach

As a newcomer to JSON, I have a question - how can I iterate through JSON data (which includes object data and object array data) using jQuery/javascript that is retrieved from an AJAX response? To illustrate, here is an example of the JSON data: { "p ...

Ways to transmit data to database without having to refresh the page

Struggling with sending data to the database using AJAX? The submit button doesn't seem to trigger any action and the page remains static. All JavaScript files are correctly referenced, so it's puzzling why things aren't working as expected. ...

PHP CI: Tackling the London Daylight Saving Time Problem

Looking to transform any timezone into the LONDON timezone. Daylight saving time is not being considered at this point. If my current time is: 07-04-2016 03:00 PM, then in LONDON it should be: 07-04-2016 10:30 AM In my situation, it is currently: 07-04-2 ...

Adding new data to Codeigniter database

Having recently started to work with codeigniter, I have encountered a challenge when it comes to inserting data into my MySQL database. While I am able to retrieve information from the database through a controller called home.php using a model I create ...

transferring information from the controller to the model

On my website, I have a piece of code that sends data to Ajax and performs well when adding items to the cart. public function addToCart() { $lapId = $this->input->post('id_lap'); $numItems = $this->input- ...

What sets apart codeigniter's controller and libraries?

During my interview today, I was presented with the question above by the interviewer. Now I'm curious - what is the correct response? ...

Form_Open will automatically submit - Ajax Submission in CodeIgniter

I am facing an issue with submitting my form via Ajax. Despite setting up a function to prevent the page from refreshing upon submission, it seems like the form still refreshes the page every time I click submit. I even tried creating a test function to lo ...

Converting query strings to paths in CodeIgniter using Apache's .htaccess configuration

Need help with converting URLs on a CodeIgniter based website from index.php?option=test&controller=con1 to /test/con1 using .htaccess. I've tried various examples found online but none of them seem to work, as the site keeps redirecting to the ho ...

Using Codeigniter to paginate JSON array outputs from a REST API

Is it possible to implement pagination for a JSON array response in a CodeIgniter REST API controller? Can the controller's index_get function be modified to accept two variables (one for the controller function and one for the page number for paginat ...

Establishing secure login systems in Codeigniter framework

In my project, I have implemented CodeIgniter as the PHP framework. However, there are concerns about its vulnerability in the login process, with someone claiming they can easily log in without a password. Currently, I am only using MD5 hashing for secure ...

Can anyone provide assistance with formatting arrays?

I am working with two arrays where I need to compare elements and populate a new array based on certain conditions. Array1: $days contains a list of dates. $days = Array ( [0] => 2012-06-23 [1] => 2012-06-24 [2] = ...

Securing Codeigniter against CSRF attacks with AJAX integration

Seeking assistance to troubleshoot a problem with AJAX call in Codeigniter while having CSRF protection enabled. Typically, the system functions smoothly with AJAX/jQuery calls and CSRF protection. However, I am currently facing difficulties with the code ...

Fixing a Dropdown Problem in Codeigniter

I have encountered a problem with the Dropdown pop-up feature. Specifically, when I click on the "Add New" option in the Dropdown, the pop-up window fails to open. Here is the code for the Dropdown: echo form_dropdown('Birth_Certificate_Storage_id['.$key ...

It is not possible for $_GET to loop through an array

I have a list of values called dataId obtained from checkbox selections, and I want to send it via a GET AJAX request: dataId = 1, 2, 16, 15, 17, 3, 14, 5, 9, 11; URI = "<?php echo site_url('Terpasang/Update_Kebutuhan_ke_Terpasang')?>"; $.ajax({ ...

query the database to retrieve information from a dropdown menu that shows connected services using the CodeIgniter framework

I am currently utilizing both Codeigniter and bootstrap in my project. Within my project, I have two select options named "service" and "sub-service". The values for these options are stored within an array. Here is a visual representation of the options: ...

What steps do I follow to include a class in Codeigniter?

Enom API utilizes its own interface instead of Codeigniters. The code snippet below demonstrates this: <?php require_once( dirname(__FILE__) . '/class.EnomInterface.php' ); Class EnomService extends EnomInterface{ ... Although there are mor ...

Retrieve information from the identical registration form in Codeigniter

https://i.stack.imgur.com/FWTIf.png The student registration form includes fields for father and mother information in the student table, while guardian information is stored in a separate guardians table. When selecting "Father" in the "Guardian Informat ...

I am currently utilizing Ajax to trigger the forgot password button, which then sends an email to a specific email address through CodeIgniter

When using ajax to click the forget button and send an email to a particular email address, I am getting an error "Fail". Can anyone help me figure out what the problem might be? Below you can see the form and controller code: Form <div class="field-w ...

I am attempting to establish a connection to a database using PDO within the CodeIgniter framework

$database_config = array( 'hostname' => 'mysql:host=myhostname;dbname=test;', 'username' => 'root', 'password' => '', 'database' => 'test', 'dbdriver' => 'pdo' ); Error Message: PDO::__construct(): php_network_getaddress ...

sending an array from one CodeIgniter view to another view via Ajax

In the following code segments of my application, myArray is an array where each element contains a few objects that I need to use in a second view. When I use alert(myJSON);, I am able to see the array in the alert window. However, when the view loads, i ...

Receiving a null value from the database query

Hey there, new member joining the group! Not sure if I got the title right, so apologies in advance... I'm attempting to transfer data from one table to another for the correct user. In the controller: function Admin(){ $user = $this->input->p ...

Unable to remove file in CodeIgniter

Within the structure of my project, there is a directory labeled secure located in the root. The overall package of the project appears as follows: application secure system ........... Images are being uploaded inside the secure folder upon form submi ...

Issue: Json variable is not defined

Retrieve States Based on Chosen Country I have set up three select boxes for choosing area, state, and country. The issue arises when I try to fetch city and area information as it throws an error stating "undefined variable" in other scripts that were fu ...

Why does this fatal error remain uncaught in PHP?

function errorExceptionHandler($no, $str, $file, $line) { if ($str != "Only variables should be assigned by reference") { echo '<br/><pre>'; echo "<b>[ERROR] ".$str." in ".$file." on line ".$line."</b><br/> ...

I am experiencing issues with the functionality of my ajax form request

I am trying to display an alert message on my page but it doesn't seem to be working. Below is the code from my view: $.ajax({ url :"<?php echo base_url();? >booking/dispatch_challan/DispatchChallanController/createDispatchChallan", t ...

Issues encountered with invoking function in CodeIgniter controller through Ajax

Running a codeigniter website with an add to cart functionality. When the user clicks the add to cart button, the product is successfully added to the cart after the page reloads. The controller code for this feature is as follows: public function buy($ ...

CodeIgniter's GROUP_CONCAT function allows you to concatenate the values

I'm currently having trouble figuring out how to create my group_concat with my SQL request in CodeIgniter. I have a table listing all my queries, using the Jtable library. Everything works fine except when I attempt to insert GROUP_CONCAT. Below is my m ...

tcpdf was unsuccessful in functioning as intended

I'm experiencing an issue with the TCPDF library in Codeigniter and need some assistance. The error message I received is as follows: TCPDF ERROR: [Image] Unable to get image: /home/mrakodol/public_html/ecarrent/ecarrent/tcpdf/cache/img_QwbOB4 Despite ha ...

Using symbolic links prior to the controller/method in CodeIgniter

Feeling a bit stuck and in need of help, I've decided it's time to reach out for some assistance. Here's my situation - I've been attempting to use a symbolic link to mask my URL like this: www.website.com/uk/controllers/method/etc www ...

What is the method for showing an image in an email using CodeIgniter?

$this->load->library('upload'); $this->load->library('email'); $this->email->set_newline(" "); $this->email->from($email); $this->email->to($cus_email); $this->email->subject($promo_name. ...

Utilizing the dynamic capabilities of Ajax in tandem with the popular Jquery and Code

tag, I have a scenario where a controller is sending data from two functions in a model to a view. This involves retrieving the results of 'waiting' and 'beingseen' functions and passing them to the 'studentqueue/studentqueue' ...

Unlock the power of fetching string values in an array with Json using CodeIgniter

In my current CodeIgniter project, I am working with an array where I have stored the studentAbsentId in JSON format as follows: [studentAbsentId] => ["1","2"]. Controller Section public function admin_getabsentlist() { $data = array( "schoo ...

Wrapping an anchor tag with a div in Codeigniter

Can a div tag be used inside an anchor function? I have a div with the following CSS: #first{ opacity:0; } Now, I want to include it in my anchor element. Here is the code snippet: <?php if(is_array($databuku)){ echo '<ol>&l ...

Managing subfolder controllers in CodeIgniter using routes

When working with two controllers in subfolders, I want to display only the function name in the URL instead of the controller names. $route['admin/test'] = "admin/sample/test"; $route['admin/test1'] = "admin/index/test1"; Admin represents a subfolder ...

Exploring the power of combining data in CodeIgniter

I've encountered an issue with a join query in CodeIgniter where only one table's data is being displayed, and not the other. As a newcomer to CodeIgniter, I'm struggling to troubleshoot this problem. Could someone please lend me a hand? Tha ...

What steps can be taken to address an unusual conflict arising between a form post and an ajax post

One web page features the use of ajax for editing existing values. This is achieved by utilizing jQuery Inline Edit to post new data, update records, and return with success. The process works well initially. Subsequently, I implemented the functionality ...

Utilize a separate domain for sections of the URL within CodeIgniter

I am interested in creating a website using CodeIgniter (CI) where users have their own personal page with a URL structure like this: main-domain.com/index.php/sites/site_id/other-controller... However, I also want to assign a unique domain for each user ...

Utilizing CodeIgniter with PHPMailer for streamlined email delivery using Google SMTP servers

Seeking assistance with transitioning this form to G SMTP from PHP. My attempts thus far have been unsuccessful; can anyone pinpoint the issue? Appreciate any help! Here is my existing script: if (count($email_body) > 0) { ...

Fetching data from multiple tables in CodeIgniter using PHP and jQuery and returning it asynchronously with Ajax

Currently, I am utilizing jQuery to retrieve JSON data through AJAX from a CodeIgniter backend and MySQL database, which is functioning correctly. However, the issue I am facing is that in addition to fetching the data returned to the jQuery function, I al ...

Fetch and showcase JSON information from a CodeIgniter method

Is there a way to retrieve data from a SQL database using ajax (json) with Codeigniter or PHP? I have attempted it, but the result shows up as "undefined." Here is the code snippet: My jQuery code snippet: $('[id^="menuitem_"]').on('click',function(){ va ...

How to dynamically populate a select option with data from a database in CodeIgniter 3 and automatically display the result in a text

How can I fetch select options from a database in CodeIgniter 3 and display the result in a text field and span area? Currently, I am only able to display data from the row_name when an option is selected. Here is my current implementation: <?php $query ...

Chrome and Firefox provide excellent compatibility for running JavaScript, whereas Safari may encounter some issues. Opera's performance with JavaScript can be quirky

Disclaimer: I'm new to web design and development. I have encountered an issue with posting information from a form built on CodeIgniter using jQuery. The form posts successfully in Chrome and Firefox, with the current page automatically reloading. Howeve ...