codeigniter

Run webpage on localhost

最后都变了- 提交于 2019-12-25 07:58:32
问题 I am working on a project with MVC architecture and using the codeigniter framework. I keep on getting an error when i try running the file in the following way. http://localhost:9080/internship-management/sourcecode/codeigniter/index.php/vacancyManagement I've set the base_url in the config.php file in the config directory as follows */ $config['base_url'] = 'http://localhost:9080/internship-management/sourcecode/codeigniter/'; /* I have my project Internship-Management inside the C drive

Error on passing data from controller to view of Codeigniter

倖福魔咒の 提交于 2019-12-25 07:57:57
问题 I am facing a wired problem for more than 2 hours. I couldn't figured it out. I am trying to pass the variable "errors" from model to view but when I try to load the page it shows error saying "undefined variable: errors" . I am trying to build a "register" page for registering new users. Here is my controller for register function register(){ if($_POST){ $config = array( array( 'field' => 'username', 'label' => 'Username', 'rules' => 'trim|required|min_length[3]|is_unique[users.username]' ),

Error trying to fetch data from 2 tables codeigniter

风格不统一 提交于 2019-12-25 07:55:24
问题 I gotta fetch data from 2 tables.. My tables are "Study","Users" and "Subjects" "Study" includes: (id, user_id[is the foreign key to the column "id" of the table "Users"], subject_id[is the foreign key to the column "id" of the table "Subjects"], grade, date) "Users" includes: (id,username,name,lastname,password,type,status,date) "Subjects" includes: (id, career_id, name, description, hours) I wanna get something like this at the end: I got this errors: Here is my code: My view file ("home"):

Callback Function Error ( Unable to access an error message corresponding to your field name )

核能气质少年 提交于 2019-12-25 07:54:10
问题 I am new to Codeigniter. I have error when i try to check the email is existed or not. I saw lot of post on Stackoverflow and other website. I can't get any result. When i try with below coding i got below errors Unable to access an error message corresponding to your field name Email.(email_check) Please check my code. Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Main extends CI_Controller { public function index() { $this->login(); } public function

Codeigniter router to pass url segment as $_GET query

余生颓废 提交于 2019-12-25 07:49:42
问题 How can I set codeigniter to route this: /download/folder/file.ext to this /download?path=folder/file.ext ? I know how to do it using .htaccess , but is it possible in CI only? I tried $route['download/(:any)'] = "download/index/?path=$1"; didn't work ... thanks 回答1: I urge you to change your perspective of what the CI Router class does (this was the most difficult thing for me in moving from the "rewriting" approach to the "router" approach). Your question assumes a "rewriting" approach, and

Codeigniter login with facebook nothing happens

╄→гoц情女王★ 提交于 2019-12-25 07:49:00
问题 I want to create a login with Facebook in my website. I found a code in the internet that made it simple loading the library of Facebook php sdk. I tried the code but it doesn't work in me. Please help me how to do login with facebook in codeigniter. Here is the code : <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once( APPPATH . 'libraries/facebook/src/facebook.php' ); class FacebookApp extends Facebook { var $ci; var $facebook; var $scope; public

codeigniter + hmvc + smarty or using common libraries within modules

荒凉一梦 提交于 2019-12-25 07:47:51
问题 I'm building a website using CI, HMVC and Smarty. It's my first time using HMVC and I don't understand how I can use common libraries within the modules. I prefer using Smarty on my sites and usually it's a piece of cake: I create a wrapper for smarty, autoload it and use it in controllers where necessary. But now I need to use smarty within the module controller and I don't know how to access it. Any ideas how I can do that? I've been researching the issue for a couple of days, with no luck.

Update code igniter config file during installation

99封情书 提交于 2019-12-25 07:42:51
问题 I know this question asked multiple times but almost all answer telling save in db or $this->config->set_item . However those answers do not apply for me. I'm not making a website but an open source project and working on the installation script for non technical persons, that will setup every thing for user during installation. For this I need to update config file with user specific settings during installation and form admin panel later, if user need. Obviously saving in DB doesn't

how to count the matched keywords using select in mysql codeigniter php?

一曲冷凌霜 提交于 2019-12-25 07:42:25
问题 how to count the matched keywords using select in mysql codeigniter php? here is my table Ex. assuming that the search keywords are yes, test messages table id | title | msg |date ---+-----------+-------------------+-------------+-- 1 | test1 | yes | 2016-06-01 // 2 match keywords 2 | yes1 | no | 2016-06-02 // 1 match keywords 3 | test2 | no | 2016-06-03 // 1 match keywords 4 | yes2 | yes yes yes | 2016-06-04 // 4 match keywords 5 | yesyes3 | yes yes yes yes | 2016-06-05 // 6 match keywords

codeigniter email->send being send twice

最后都变了- 提交于 2019-12-25 07:36:18
问题 i am using codeigniter 2 with the tank_auth library. in the model named user_model it has an function (_send_email()) to send an email: function _send_email($type, $email, &$data) { $this->load->library('email'); $this->config->set_item('language', 'dutch'); $this->email->set_newline("\r\n"); $this->email->from($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth')); //$this->email->reply_to($this->config->item('webmaster_email', 'tank_auth'),