codeigniter-2

codeigniter + require letters and numbers in password

空扰寡人 提交于 2019-12-05 07:58:27
I'd like to use form validation to require a password that has BOTH alpha and numeric characters. Here's what I've come up with so far: $this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]|min_length[8]|alpha_numeric'); The issue is that "alpha_numeric" requires that the password only contain letters or numbers, it doesn't require both. Going for the stronger password option here. You could set up a callback in your controller: public function password_check($str) { if (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) { return TRUE; } return FALSE

CodeIgniter 2 + Zend 2 library barcode

自古美人都是妖i 提交于 2019-12-05 07:08:41
问题 Problem: rendering barcodes in CodeIgniter via Zend library barcode. I googled, and also tried all tutorials on first 2 pages. I stackoverflowed and found quiet a few topics on my problem, even few are marked as answered but no luck. Finally I tried this https://stackoverflow.com/a/15480779/1564365 but yet another error message. error: Fatal error: Class 'Zend\Barcode\ObjectPluginManager' not found that means it is actually loading Barcode library but with error. sidenote : ZF 2.2 fresh

Is there any forum in codeigniter php? [closed]

北战南征 提交于 2019-12-05 05:49:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 11 months ago . Is there any forum software based on codeigniter ? free or commercial ? 回答1: I haven't tried either of these myself but i've heard very good things and you should take the time to investigate them both: Dove Forums Dove Forum is fairly new, but growing and seems to have fairly strong support from the Code

CodeIgniter: Validate form with multidimensional POST data

我只是一个虾纸丫 提交于 2019-12-05 03:05:46
So the framework is CodeIgniter 2.0.2. I have a form that has groups of fields that correspond to rows in a database. The names of the fields are in the format: opt[0][foo] opt[0][bar] opt[1][foo] opt[1][bar] etc... The index (1,2,etc...) does not correspond to row IDs in the database, it is simply a way to split up the groups of fields. There may be gaps in the index as users are able to add and remove an arbitrary number of the field groups. All groups are identical, that is, they contain exactly the same set of fields with the same second level names. I want to be able to use CodeIgniter's

Only variables should be assigned by reference with function

房东的猫 提交于 2019-12-05 02:25:18
I use old version of Codeigniter framework. With new version of php I am gettings this error: Only variables should be assigned by reference I am wondering if this is safe bugfix: Changing: $this->_base_classes =& is_loaded(); to $assign = is_loaded(); $this->_base_classes =& $assign; Is that the same? Md.Jewel Mia Please see this url https://github.com/bcit-ci/CodeIgniter/issues/904 You can go to file: system/core/Loader.php Then file: system/core/Common.php Line 190 there should be: function &is_loaded($class = '') IceTambidadab remove this in line 150 from system/core/Loader.php $this->

Codeigniter : displaying query result in controller

杀马特。学长 韩版系。学妹 提交于 2019-12-05 02:06:13
问题 I am trying to display my db query result in my controller, but I don't know how to do it. could you please show me? Controller function get_name($id){ $this->load->model('mod_names'); $data['records']=$this->mod_names->profile($id); // I want to display the the query result here // like this: echo $row ['full_name']; } My Model function profile($id) { $this->db->select('*'); $this->db->from('names'); $this->db->where('id', $id); $query = $this->db->get(); if ($query->num_rows() > 0) { return

Codeigniter Database Based Configuration Settings

∥☆過路亽.° 提交于 2019-12-05 01:51:08
问题 I am building an application using the latest copy of Codeigniter 2.0. My application is dynamic and is kind of like a custom CMS I guess you could say. I have a database table called 'settings' with the following fields: id name value Basically what I am currently doing is using a helper function to retrieve specific settings from my settings table like the site name or current theme. However I've started thinking that maybe the constant amount of database calls for retrieving settings is a

How to pass validation error data through redirect()?

我与影子孤独终老i 提交于 2019-12-04 22:23:17
问题 I have a page that contains a form and when any user submits it, the data goes to a controller and the controller checks the validation, if there is any error it redirects the user to the previous page( the page that contains the form), otherwise it sends data to models. To redirect to the previous page from controller (if there is any validation error), I have the following code redirect($this->input->post('redirect')); The above code is working fine but the problem is after it redirects the

CodeIgniter - Additional dbforge / migration fields

不打扰是莪最后的温柔 提交于 2019-12-04 20:50:43
Im having trouble figuring out this migrations business for CodeIgniter ... I cant find any decent documentation that explains additional field elements like current_timestamp, default datetime values etc etc I was wondering if someone could help me out to translate the following into proper dbforge->add_field arrays I need the following 2 `last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP and `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' I have copied these from the SQL insert statement from the tank_auth library. But i want to put it into

Prevent white space in query being converted to %20

大兔子大兔子 提交于 2019-12-04 19:42:20
I have the following function in my model that I want to use to search for phrases and so on. However if I pass in more than one word the spaces are always converted to the %20 symbol which breaks my query. How do I avoid this? Also is this type of query secure by default in codeigniter? or do I need to escape $term first? function get_search_entries($limit, $start, $term) { $this->db->select('statuses.id, title, status, posted_by, created, rating, name'); $this->db->from('statuses'); $this->db->join('categories', 'categories.id = statuses.category_id'); $this->db->where('MATCH (title, status)