I have a form that uploads a news article with it's picture and then stores all the info correctly. I am using codeigniter with Active Record and would like to know how to display the image with the post it was uploaded with. here is my upload script: public function create(){ $data = array('error' => ''); $config = array( 'upload_path' => './uploads', 'allowed_types' => 'gif|jpg|png', 'max_size' => '204800', 'max_width' => '1920', 'max_height' => '1080', 'encrypt_name' => true ); $this->load->library('upload', $config); if(!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $data['title'] = 'Create a news item'; $data['main_content'] = 'news/create'; $this->load->view('templates/template', $data, $error); } …

Member Avatar
Member Avatar
+0 forum 4

hi all, I am new to Codeigniter, start learning because of one of our customer want the conversion of their some Oracle Forms to web app and I found it is much easier to use CI framework of PHP but one thing I can't connect / work with their Oracle database 12c Release 2. I have a VM with Win 8, Oracle DB 12c and WAMP ( latest downloaded on 10-Nov-2018 ). I searched for it and found various solution (not any of 12c), tried some but still I failed to even load data from a table. can somebody help …

Member Avatar
Member Avatar
+1 forum 6

hiii i need your help, i am web developer (fresher). i want display images from database/folder using ajax in codeignater. i try ur source code not working.

Member Avatar
+0 forum 0

I'm getting ` Session: Error while trying to free lock for ci_session` show up in the error log a couple times a minute, sometimes, and every 15 minutes other times. Using Redis for sessions. It's not happening on a different server that has almost the same code base and is sharing the same Redis server, albeit with a different session name. I'm using session_write_close() on every page as soon as I'm done handling sessions.

Member Avatar
Member Avatar
+0 forum 5

How to convert the Codeigniter code to normal HTML and PHP? Basically, I want to merge my older Codeigniter code with new HTML, CSS and PHP code.

Member Avatar
Member Avatar
+0 forum 1

Hello friends, I want to develop a online typing tutor using codeigniter......for hindi language (typing in computer with the help of **hindi indic 3** or** hindi indic 2 typing tool**) .......i know the php and codeigniter with css.....please give me guidance to develop it......what language i need to learn.....and how can be typing using these tool............. how many days will it take to learn............

Member Avatar
Member Avatar
+0 forum 4

Hello, I am trying to prevent SQL Injection on Codeigniter. I am reading this link: https://www.roytuts.com/prevent-sql-injection-in-codeigniter/ I do not understand what is the purpose of Escaping Queries, Query Binding and Active Record. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

I am using codeigniter 2.1.2 on Win 8.1 and the following code is not working $this->load->library('image_lib'); $config['image_library'] = 'GD2'; $config['source_image'] = 'C:/xampp/htdocs/imgt/wall/wallpaper2.jpg'; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 75; $config['height'] = 50; $this->load->library('image_lib', $config); var_dump( $this->image_lib->resize()); // this returns true What is the problem i checked GD is installed ?? I also tried the same code in 2.2.0 here too not working

Member Avatar
Member Avatar
+0 forum 5

I recently had to mass insert a really large text file of strings into MySQL. Here's how I did it.

Member Avatar
Member Avatar
+1 forum 1

I am using two database one is default which I would like to set db name as per session value, second database I am using to login and registration and set session once user logged in. Can anyone have solution to manage this database name after login of user based on session value.. I am using codeigniter framework

Member Avatar
Member Avatar
+0 forum 3

Hi I have problem that cannot show form validation errors in view . I am using ajax to post data to controller. Here is my Controller's Validation part private function _validate() { $this->form_validation->set_rules('Name', 'Name', 'required|alpha'); $this->form_validation->set_rules('CellNo', 'CellNo', 'required|numeric'); $this->form_validation->set_rules('Address', 'Address', 'required'); $this->form_validation->set_rules('Rate', 'Rate', 'required|numeric'); $this->form_validation->set_rules('Advance', 'Advance', 'required|numeric'); $this->form_validation->set_rules('BottlesQty', 'BottlesQty', 'required|numeric'); $this->form_validation->set_rules('DeliveryDay', 'DeliveryDay', 'required'); $this->form_validation->set_rules('DeliveryPerson', 'DeliveryPerson', 'required'); $this->form_validation->set_rules('referenceName', 'referenceName', 'required'); if ($this->form_validation->run() == FALSE) { $errors = validation_errors(); echo json_encode(['error'=>$errors]);} } Here is view with ajax <div id="print-error-msg" class="alert alert-danger " style="display:none"></div> //part of ajax posting to controller var formData = new FormData($('#form')[0]); $.ajax({ url : url, type: "POST", data: formData, …

Member Avatar
+0 forum 0

Hi This question or similar were 4 years ago has already been asked but in my situation did not help. I have codeigniter project. in my employee database I have TINYINT field status. if 1 employee is active otherwise inactive. my form is in bootstrap modal. here is switch button code: <div class="onoffswitch3"> <input type="checkbox" name="status" class="onoffswitch3-checkbox" id="myonoffswitch3" data-format="Y-m-d" required > <label class="onoffswitch3-label" for="myonoffswitch3"> <span class="onoffswitch3-inner"> <span class="onoffswitch3-active"><span class="onoffswitch3-switch" id="onoffswitch3-switch">Active</span></span> <span class="onoffswitch3-inactive"><span class="onoffswitch3-switch" id="onoffswitch3-switch">Inactive</span></span> </span> </label> </div> question is how can I get value of switch either it is 1 or 0. ( on form when I am clicking switch …

Member Avatar
+0 forum 0

Hi, I'm trying to create and save breadcrumbs from recursive function. I manage to display hierarchical tree using recursive function. but I'm I am having hard time creating breadcrumb and save them one by one to my database. here is my table cat_id parent_id title 10 0 shoes 11 0 clothes 12 10 socks 13 11 long-sleve 14 11 T-shirts ... My desire output is like this: Home > Category1 > item Home > Category1 > item Home > Category1 > item Home > Category2 > item Home > Category2 > item Any idea thanks..

Member Avatar
+0 forum 0

I am literary about to bleed...I have a single controller that will accept POST request from an external domain. Once the post data arrives (usually a number or a date), it returns json data. The problem is CORS error in firefoz and chrome. Only that controller is going to be accessed from other domains. I have tried header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow- Methods: POST, GET, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Headers: X-Requested-With, content-type, X-Token, x-token'); just after opening the php code, in the constructor and even the method but nothing changes at all. My current htaccess looks like this: RewriteEngine on RewriteCond $1 !^(index\.php|public|\.txt) …

Member Avatar
Member Avatar
+0 forum 2

i need someone who can give me his email so i can send my timetable generator software that is given me errors. please anyone who can be of assistance, i will be grateful.

Member Avatar
Member Avatar
+0 forum 2

I want to attach two excel files (sealing_production.xls & sealing_assembly.xls)to my email using php,but I have no idea on how to do it. **Problem** When I click on my send mail button, I gets the mail. with all details. but attachment is not working. **Try** I echo the file name, its prints the file name from controller Here my php code for the send Email function function sendEmail() { $user = "dheanas@gmail.com"; $cc = "as@gmail.com"; $status = "Dear All,"; $date = date("y-m-d") ; $xls = "Sealing Report/{$date}/sealing_production.xls"; $xls1 = "Sealing Report/{$date}/sealing_assembly.xls"; $subject = "Sealing Daily Production & Daily Output Report …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I wanna use Payment Gateway integration with CodeIgniter, I am new to this thing, so I don't have any idea about that yet... can you guys help me with this ?

Member Avatar
Member Avatar
+0 forum 1

if click second link the url pass value but then i click next the url value will empty. any one healp me ...! this is my controllere public function search() { $this->load->library('pagination'); $prdictive= $this->input->post('printable_name'); $category=$this->input->post('category'); $area=$this->input->post('area'); $this->load->library("pagination"); $config = array(); $config["base_url"] = base_url() . "Main_control/search/".$area.'/'.$category; $area2 = $this->uri->segment(3); $category2 = $this->uri->segment(4); $page = $this->uri->segment(5); $config['total_rows'] = $this->Main_model->record_count($category,$category2,$area,$area2); $config["per_page"] = 3; $config["uri_segment"] = 5; // $choice = $config["total_rows"] / $config["per_page"]; // $config["num_links"] = round($choice); $config['page_query_string'] = false; $config['reuse_query_string'] = true; $config['full_tag_open'] = '<ul class="pagination">'; $config['full_tag_close'] = '</ul>'; $config['first_link'] = false; $config['last_link'] = false; $config['first_tag_open'] = '<li>'; $config['first_tag_close'] = '</li>'; $config['prev_link'] = …

Member Avatar
+0 forum 0

I have site using php frame work codigniter where I am using the mattdiamond/Recorderjs to record an audio file in blob content type then i am uploading it to the server but it is taking top much time to upload I want to minimize my uploading time. Max size of audio file is 4mb and it is taking 1 minute to 4 minutes for uploading to server. $(document).on("click", "#save:not(.disabled)", function(){ Fr.voice.export(function(blob){ var formData = new FormData(); formData.append('file.wav', blob); formData.append('question_id',question_id); formData.append('test_id',test_id); formData.append('section_id',section_id); formData.append('sub_section_id',sub_section_id); $.ajax({ url: "https://www.example.com/pte/upload", type: 'POST', data: formData, contentType: false, processData: false, success: function(response) { if(response.status=="success"){ $('#recording-status').html("Recording save successfully."); …

Member Avatar
Member Avatar
+0 forum 1

Hello, I'm trying to edit data from a selected table row by using contextmenu. But when I try to select a row for edting instead the **LAST DATA in a row** will fetch. Table: <div class="container"> <div class="row"> <div class="col-md-12"> <div class="table-responsive"> <table id="ppmpsupplies" class="table table-bordered table-hover" cellspacing="0" width="100%"> <thead> <tr> <th>Code</th> <th>General Description</th> <th>Unit</th> <th>Quantity</th> <th>Estimated Budget</th> <th>Mode of Procurement</th> <th>Actions</th> </tr> </thead> <tbody> <?php foreach($items as $item){?> <tr> <td> <?php echo $item->id;?> </td> <td> <?php echo $item->description;?> </td> <td> <?php echo $item->unit;?> </td> <td> <?php echo $item->quantity;?> </td> <td> <?php echo $item->budget;?> </td> <td> <?php echo $item->mode;?> </td> …

Member Avatar
+0 forum 0

In my registration page i want user to select multiple images and upload it i am saving images name in database for reference. I am successful in uploading single images in database and can also show image in view but now i have problem in uploading multiple images. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ini_set("display_errors",1); class Update_profile extends CI_Controller { var $file_path; //for original image var $file_path_url; //for thumbnails function __construct() { // Call the Model constructor parent::__construct(); $this->load->library('session'); $this->is_login(); $this->load->helper(array('form', 'url')); $this->load->model('Edit_profile'); //return full path of directory //Make sure these directory have read and write …

Member Avatar
Member Avatar
+0 forum 8

How to create a website by pressing a button? With one button "create a website" while the user press that button it will create another website which is exactly the same like the first one. The only difference is that it will allow the user to select any name as they want which is followed by the same domain name. For example: user1.domain.com user2.domain.com How to do that? Is that possible? I am using codeigniter / laravel

Member Avatar
Member Avatar
+0 forum 4

Hello. I'am using php codeigniter for my task here. i just have to use it. its all set up at the first. so i kinda not understand the path. I've read some of the explainatiion and try from scratch but when I try to apply it to my task its not working and even make me more confusing. So anyone here can help me to solve these submit form to email issue? This is the final thing beforei I can submit my task. I got no problem to use codeigniter to route my files and all I just stuct at …

Member Avatar
Member Avatar
+0 forum 13

Hi, i am beginer to codeignitor,i know how to write basic active queries in CI. i want to know how to write a query(having multiple conditions,double parentheses) in which supports CI. query is: $query="SELECT * FROM `apply_special_leave` WHERE ((`from_date` <= '$dt1' AND '$dt1' <= `to_date`) OR (`from_date` between '$dt1' AND '$dt2')) AND user_id='$user_id' AND status!='2'"; thank you.

Member Avatar
Member Avatar
+0 forum 3

I'm beginning to wonder... I hope someone can clarify my doubts. First let me explain. So I've been using codeigniter's session library without much thought. I assumed the code was just some wrapper for PHP native sessions. So I assumed it was stored server side so encryption and all that jazz I needn't worry about. Then I began to do some digging and realised to my horror it is stored client side in the cookie. Codeigniter uses it's own session, it is not a PHP session at all. Now I know you can't use codeigniter's session without setting an encryption …

Member Avatar
Member Avatar
+0 forum 12

Having an issue passing info from the modal to the model so that I can do a where statement. The first line below is the link to open the modal. Works fine no issues. <td><a href="javascript:;" class="openModal" data-toggle="modal" data-target="#email_details_<?php echo $SP->fit_tv_rollout_info_id;?>"> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> </a></td> <div id="email_details_<?php echo $SP->fit_tv_rollout_info_id;?>" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <!-- dialog body --> <div class="modal-header"> <h4 class="modal-title"> Contractor Email Details <?php echo $SP->chain;?> - <?php echo $SP->location_name;?> </h4> </div> <form class="email_details_form"> <div class="modal-body"> <?php if($contractor_email_details):foreach($contractor_email_details as $CED):?> <?php echo $CED->contractor_name;?> - <?php echo $CED->contractor_email;?> - <?php echo $CED->date_sent;?><br> <?php endforeach; else:?> <b><i>Sorry there …

Member Avatar
Member Avatar
+0 forum 1

controllers/Cspages.php public function index() { $this->load->helper('url'); $this->load->model('gallery_model'); $pic_unique_id = 18; // slider $data['pic'] = $this->gallery_model->get_picture($pic_unique_id); $this->load->view('index', $data); } views/index.php <?php foreach($pic as $pic_item): ?> <img src="<?php echo base_url('assets1/images/slider/'.$pic_item->pic_item );?>"> <?php endforeach;?> models/gallery_model.php public function get_picture($pic_unique_id) { $query = $this->db->get_where('galleries_pictures', array('picture_unique_id' => $pic_unique_id)); return $query->result(); } Now the result is: A PHP Error was encountered Severity: Notice Message: Undefined property: stdClass::$pic_item Filename: views/index.php Line Number: 214 I wonder how to fix this result so that I could see the picture appears on my view.

Member Avatar
Member Avatar
+0 forum 12

When accessing from ######1.co.uk (which has an SSL) to document root ###/production everything works fine. However when accessing ###/production from ######2.co.uk (which doesn't have an SSL - set up in the vhost file) the home page displays fine but the other pages are returning a 404. Here's the entry in the vhost file that points #####2.co.uk to ###/production <VirtualHost *:80> DocumentRoot "/var/www/html/####/production" ServerName #####2.co.uk ErrorLog "/etc/httpd/logs/####.error.log" CustomLog "/etc/httpd/logs/####.log" common <Directory /var/www/html/####/preprod> AuthType Basic AuthName "Authentication Required" AuthUserFile "/var/www/html/secure/.htpasswd" Require valid-user order allow,deny allow from all AllowOverride all </Directory> <Location /api/sms> AuthType Basic AuthName "Authentication Required" AuthUserFile "/var/www/html/secure/.htpasswd" Require valid-user </Location> …

Member Avatar
Member Avatar
+0 forum 2

In creating dropdown in my project encounters problems(errors). I'm very new to codeigniter. Please check and advise what is wrong with with my code? **Model** Public function get_region() { $return = array(); $query = $this->db->get('region')->result_array(); if( is_array( $query ) && count( $query ) > 0 ) { $return[''] = 'please select'; foreach($query as $row) { $return[$row['id']] = $row['r_e_name']; } } return $return; } **Controller** public function index() { $this->load->model('country_model'); $data['countries'] = $this->country_model->get(false); $data['page_title'] = "Countries"; $data['return']=$this->country_model->get_region(); $this->template->show('countries', $data); } **View** <tr> <td> <?php echo form_label('Region Name *', 'r_e_name'); ?> </td> <td> <?php echo form_dropdown('r_e_name', $return);?> </td> </tr> **Errors** A PHP …

Member Avatar
Member Avatar
+0 forum 5

This is to enter the admin page: http://localhost/masterlinkci2/admin/ admin/views/login.php <?php $this->load->library('form_validation'); ?> <?php echo validation_errors(); ?> <?php echo form_open('cpages/ceklogin'); ?> <div class="login-card"> <center><?php //echo $warning; ?> <?php echo $this->session->flashdata('warning'); ?> </center> <h2>Gionda CMS Login</h2><br> <form> <div class="login"><input type="text" name="username" placeholder="Username"></div> <div class="login"><input type="password" name="password" placeholder="Password"></div> <br> <input type="submit" name="login" class="login login-submit" value="login"> </form> <div class="login-help"> <a href="#">Register</a> • <a href="#">Forgot Password</a> </div> </div> admin/controllers/cpages.php public function ceklogin() { $username = $this->input->post('username', TRUE); $password = $this->input->post('password', TRUE); $this->db->where('username', $username); $this->db->where('password', $password); $query=$this->db->get('login'); if ($query->num_rows() >= 1) { // echo 'LOGIN BERHASIL !'; $this->load->model('Mpages'); $data['login']=$this->db->get('login'); $data['login']=$this->Mpages->login(); $this->load->view('index', $data); } else { // …

Member Avatar
+0 forum 0

The End.