Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,091
» Latest member: a3lanjo
» Forum threads: 67,623
» Forum posts: 422,763

Full Statistics

Latest Threads
javascript in Extension e...
Forum: General Help
18 minutes ago
» Replies: 0   » Views: 6
Cannot Pass More than two...
Forum: Model-View-Controller
34 minutes ago
» Replies: 4   » Views: 81
ci-phpunit-test for CodeI...
Forum: Addins
1 hour ago
» Replies: 87   » Views: 55,204
custom helper function
Forum: Model-View-Controller
1 hour ago
» Replies: 4   » Views: 137
Lost session
Forum: CodeIgniter 4 Support
2 hours ago
» Replies: 13   » Views: 232
Unable to locate the spec...
Forum: General Help
2 hours ago
» Replies: 8   » Views: 169
Share PHP Sessions across...
Forum: General Help
2 hours ago
» Replies: 1   » Views: 52
can't get link to work
Forum: General Help
2 hours ago
» Replies: 35   » Views: 13,975
Validation error messages...
Forum: General Help
3 hours ago
» Replies: 2   » Views: 51
Security with CI
Forum: Best Practices
3 hours ago
» Replies: 5   » Views: 536

  javascript in Extension event not firing
Posted by: richb201 - 18 minutes ago - Forum: General Help - No Replies

I am trying to get the "week" input control working in my Extension popup.js file. Here is the def

    <label for="week">What week?</label>
    <input id="week" type="week" name="week" value="2017-W01" onchange="set_theweek()">

In my popup.js file I have a function:

    //sets the week control to this week 
    function set_theweek()
   var currentTime = new Date();      <<breakpoint on this line
   var week=getWeek(currentTime);

I can display the week "picker" fine. When I change the date in "week", I thought that set_theweek() would execute, but it doesn't. I have a breakpoint that never fires. All the examples of using "week" seems to POST to the backend. In my case, since this is an Extension, I can't do that. I just want to find out what week the user set the control to. Any ideas why my callback isn't working?

I also tried changing the event in the html file to oninput.  I am getting the following error:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

What does this mean?

  Question For SMS
Posted by: a3lanjo - 3 hours ago - Forum: Libraries & Helpers - No Replies

How integration SMS APIs with codeigniter, The API am used as below :


  Validation error messages below or beside fields
Posted by: danangeloalcanar - Yesterday, 07:53 PM - Forum: General Help - Replies (2)

Hi CI community,

I have a simple question, but I can't produce the answer however I tried to think of it.

Here is my scenario:

I have a registration form. So users fill it out.

Now, if the validation criteria was not satisfied, the form will show validation errors right? 

<?php echo validation_errors(); ?>
The error messages will display above the form, right?

Now, here is what I want to accomplish. 

I want to show the error for each field, just below the field.

For example, I have a validation rule for the username, that it must be at least 6 characters long. If the user inputs 4 characters only,
I want the error to show just below the field. 

So if  I have error messages for username field and password field, the error messages for the username field will show below the username field, and the error messages for the password field will show below the password field. at the same time.

Now, here's a solution I am thinking but I don't know if it is the right way.

I will just set a flashdata for each field? and if it is set, I will just show it  like this:

if ($username < 6) {
    $this->session->set_flashdata('is_less_than_six', 'Username must be at least 6 characters long.');

And then create a span element below the username field:
if ($this->session->flashdata('is_less_than_six')) {
    echo $this->session->flashdata('is_less_than_six');

Is that a good solution? We know it will work, but how about repopulation the fields?

Hope you can guide me guys. I want to make my validation errors understandable to the users. Thankyou.



  Share PHP Sessions across sub domains
Posted by: cosmo - Yesterday, 12:31 PM - Forum: General Help - Replies (1)

I am trying to set up the following:


where if the user visits sub1.domain.com or sub2.domain.com and they are not logged in, they get pushed over to auth.domain.com and can log in. sub1.domain.com and sub2.domain.com are two separate applications but use the same credentials.

I tried setting the following in my php.ini:

session.cookie_domain = ".domain.com"

but it doesn't seem to be passing the information from one domain to the other.

  Cannot Pass More than two variable to view
Posted by: sanjaya - Yesterday, 11:18 AM - Forum: Model-View-Controller - Replies (4)

 I try to get total of price column in personal assets table. But I have below error.. 

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: employee/inventory.php
Line Number: 61
File: C:\wamp64\www\MY\admin\application\views\employee\inventory.php
Line: 61
Function: _error_handler

File: C:\wamp64\www\MY\admin\application\controllers\Employee.php
Line: 223
Function: view

File: C:\wamp64\www\MY\admin\index.php
Line: 315
Function: require_once

My Model: 

PHP Code:

Class Employee_model extends CI_model
    public function 
parent:: __construct();

public function 
       $query $this->db->query("SELECT
               sgh.employee WHERE sgh.employee.company_id=sgh.company.id AND sgh.employee.id='
       $employee_data $query->row();
       return $employee_data;


   public function view_inventory($id){
   $query $this->db->query("SELECT sgh.inventory.id,
                                  FROM sgh.inventory,
                                  sgh.employee WHERE sgh.inventory.employee_id=sgh.employee.id AND sgh.employee.id='
   $item_data $query->result_array();
       return $item_data;

   function employee_spends($id)
       $query $this->db->query(" SELECT SUM(price) FROM inventory WHERE employee_id='$id'");
       $row $query->row();
       return $row;

This My Controller
PHP Code:
function personal_inventory($id)
       $employee_data["row"] = $this->Employee_model->view_data($id);
       $inventory_data["item"] = $this->Employee_model->view_inventory($id);
       //Total spends for current employee
       $inventory_data["total"] = $this->Employee_model->employee_spends($id);
      // var_dump( $inventory_data);
       if ($inventory_data["item"]== null) {
       } else {

This is my view
PHP Code:
<!-- Content WrapperContains page content -->
div class="content-wrapper">
   <!-- Content Header (Page header) -->
   <section class="content-header">
    <h2>Personal Inventory Area</h2>
   <!-- Main content -->
   <section class="content">
       <div class="row">
           <div class="col-xs-12">
               <div style="margin-bottom: 10px;" >
                       <a href="<?= base_url() ?>employee/employee_list/" class="btn btn-info btn-lg">Back

               <div class="box">
                   <div class="box-header">
                       <h3 class="box-title">Inventory Items</h3>
                   <!-- /.box-header -->
                   <div class="box-body">
                       <table id="example1" class="table table-bordered table-striped table-hover">
                               <th>Item Name</th>
                               <th>Serial Number</th>
                               <th>Product Key</th>

($item as $row){
                                    <td class="text-left">Rs. <?=$row["price"]?>.00</td>

                                <th>Item Name</th>
                                <th>Serial Number</th>
                                <th>Product Key</th>
                        <P>Total Spends is <?=$row->price?></P>
                    <!-- /.box-body -->
                <!-- /.box -->
            <!-- /.col -->
        <!-- /.row -->
    <!-- /.content -->
<!-- /.content-wrapper --> 

  CodeIgniter 4 - Brazilian Portuguese (pt-BR) Language Localization
Posted by: natanfelles - 04-20-2018, 07:58 PM - Forum: Regional User Groups - Replies (1)

Hello everyone!

I just translated the CodeIgniter 4 files into the Brazilian Portuguese language.

Certainly some translations will have to be updated until the framework be released. But, right now, you can go testing using multi-languages.

Repository is here: https://github.com/natanfelles/CodeIgniter4-pt-BR


Olá a todos!

Eu acabei de traduzir os arquivos do CodeIgniter 4 para o idioma Português Brasileiro.

Certamente algumas traduções terão que ser atualizadas até o framework ser lançado. Mas, desde já, você pode ir testando usando multi-idiomas.

O repositório está aqui: https://github.com/natanfelles/CodeIgniter4-pt-BR

  securimage and ci
Posted by: im.amideb - 04-20-2018, 02:17 PM - Forum: Libraries & Helpers - No Replies


i am trying to integrate securimage with ci but i always get bool(false).

moreover, $securimage->getCode(); throws // Message: Undefined index: code

any help?


  How to Integrate Ckeditor and KCFinder on Codeigniter Framework 3..?
Posted by: albait - 04-20-2018, 01:32 PM - Forum: Lounge - Replies (1)

How to Integrate Ckeditor and KCFinder on Codeigniter Framework 3. Please let me know. Thanks!

  Creating you own composer package
Posted by: duongduythao - 04-20-2018, 11:50 AM - Forum: Lounge - No Replies

Hello CI Community!

I am back with a new question.

As we know, sometimes we code something repetitively. For example, I always have a registration module in my project.

So I create a Model for the registration, a Controller and the corresponding Views.

Now, I am thinking.. Can I create a composer package that will include and install these files for me? So I don't have to create new files every time I start a new project.

For example, I started a new project and I need a registration module. Now, I will just run  composer require ci-registration

and the package will be installed. All the files will go to their respective folder. 

Is that possible? Have anyone tried that?

I hope I explained myself clearly.

Thankyou so much. Please bear with me. I am a beginner in CI. Hope you can guide me.

  v318 db parser bug (maybe, perhaps)
Posted by: badger - 04-20-2018, 09:03 AM - Forum: Issues - Replies (3)

up to and including v312, i was able to use queries like the following

PHP Code:
SELECT ..... FROM .... WHERE (a.transdate >= "?") AND (p.prva_id>0) AND (p.prod_id=?) 

Today i made the quantum leap to v318 and such queries crash on the part "(p.prod_id=?)".
Now it will only work if i use (p.prod_id="?") ie enclose the question mark in quotes
Switch back to v312 and it's ok
I don't know if this is a bug or if I've just been lucky in always getting away with sloppy coding.
The quotes are needed for e.g. a date or text but I've never had to use them for integers

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.