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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,135
» Latest member: shf
» Forum threads: 67,041
» Forum posts: 419,783

Full Statistics

Latest Threads
Add key to header in all ...
Forum: General Help
28 minutes ago
» Replies: 1   » Views: 65
CI do not have model to m...
Forum: CodeIgniter 4 Feature Requests
1 hour ago
» Replies: 1   » Views: 62
Case Sensitive Filenames ...
Forum: CodeIgniter 4 Feature Requests
1 hour ago
» Replies: 6   » Views: 215
Session issue
Forum: Issues
3 hours ago
» Replies: 0   » Views: 20
[sysadmin] requirements t...
Forum: General Help
4 hours ago
» Replies: 4   » Views: 214
Fetch and Update Data in ...
Forum: General Help
7 hours ago
» Replies: 1   » Views: 89
Help!! I am new at this.
Forum: Installation & Setup
7 hours ago
» Replies: 4   » Views: 125
ion_auth's 1.2mb memory u...
Forum: Addins
7 hours ago
» Replies: 2   » Views: 102
still losing session user...
Forum: General Help
7 hours ago
» Replies: 27   » Views: 927
user_agent Chrome as Oper...
Forum: CodeIgniter 3.x
8 hours ago
» Replies: 2   » Views: 164

 
Bug user_agent Chrome as Opera ?
Posted by: sthienard - 12-06-2017, 08:38 AM - Forum: CodeIgniter 3.x - Replies (2)

Hi,

I got this with :

Code:
...
'user_agent : '.$this->input->user_agent(),
'platform : '.$this->agent->platform(),
'browser : '.$this->agent->browser(),
'version : '.$this->agent->version(),
...

give 

Code:
user_agent : Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A3003 Build/OPR6.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36
platform : Android
browser : Opera
version : 6.170623.013

Opera ?? I think it is a bug ...
Regards,


  checkbox column
Posted by: FARUKB13 - 12-06-2017, 08:25 AM - Forum: General Help - Replies (2)

How do I make an extra column with checkboxes in a generated table?


Code:
$template = array(
        'table_open'            => '<table border="1" cellpadding="4" cellspacing="0">',

        'thead_open'            => '<thead>',
        'thead_close'           => '</thead>',

        'heading_row_start'     => '<tr>',
        'heading_row_end'       => '</tr>',
        'heading_cell_start'    => '<th>',
        'heading_cell_end'      => '</th>',

        'tbody_open'            => '<tbody>',
        'tbody_close'           => '</tbody>',

        'row_start'             => '<tr>',
        'row_end'               => '</tr>',
        'cell_start'            => '<td>',
        'cell_end'              => '</td>',

        'row_alt_start'         => '<tr>',
        'row_alt_end'           => '</tr>',
        'cell_alt_start'        => '<td>',
        'cell_alt_end'          => '</td>',

        'table_close'           => '</table>'
            );

        
           $this->table->set_template($template);
                return $this->table->generate($query);

Thanks in advance Smile


  Deprecation Error with Wiredesign's HMVC extension on PHP 7.2
Posted by: koficypher - 12-05-2017, 11:00 PM - Forum: Addins - Replies (8)

Just until yesterday and until i had upgraded to php 7.2 i got this error saying thIs

PHP Code:
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<
h4>A PHP Error was encountered</h4>

<
p>Severity8192</p>
<
p>Message The each() function is deprecatedThis message will be suppressed on further calls</p>
<
p>FilenameMX/Modules.php</p>
<
p>Line Number83</p>


    <
p>Backtrace:</p>
    
        
    
        
    
        
    
        
            <
p style="margin-left:10px">
            
File: /var/www/html/ci_hmvc/application/third_party/MX/Modules.php<br />
            
Line83<br />
            Function: 
each            </p>

        
    
        
            <
p style="margin-left:10px">
            
File: /var/www/html/ci_hmvc/application/third_party/MX/Loader.php<br />
            
Line251<br />
            Function: 
load            </p>

        
    
        
            <
p style="margin-left:10px">
            
File: /var/www/html/ci_hmvc/application/core/MY_Controller.php<br />
            
Line9<br />
            Function: 
module            </p>

        
    
        
            <
p style="margin-left:10px">
            
File: /var/www/html/ci_hmvc/application/modules/home/controllers/Home.php<br />
            
Line8<br />
            Function: 
__construct            </p>

        
    
        
    
        
            <
p style="margin-left:10px">
            
File: /var/www/html/ci_hmvc/index.php
            Line
315<
            Function: require_once 
any ideas on what coukd have gone wrong per the new installation php or i made a mistake somewhere.....

system info: php7.2 on ubuntu 17.10 lamp stack


  Community_Auth login or setup problem
Posted by: JeffreyB - 12-05-2017, 07:57 PM - Forum: Addins - Replies (9)

I would like to think I have a botched installation of Community_Auth, except some things are working. For my limited skills this is quite a program to troubleshoot. The author has obviously done a ton of work.

1)I can't get the login page using any of: a)index.php/examples/index or b)index.php/examples or c}index.php/examples/login

2) I DO get a page using: index.php/examples/recover

3) At that recover page I get menu options and links for:
- Login
- Ajax login
- Optional Login
- Simple verification
- Create User

All of these lead to pages, EXCEPT for the Login link. On clicking on that link, I get a 404 error which shows in the location bar as: /index.php/login?redirect=examples%2Foptional_login_test

4) This is similar to the link for the Login on that page which on a mouseover shows as: index.php/login?redirect=examples

5) The CI log file tells me everything is loading okay, except for the session path not being set, and sending a message the CI log file as:
Session: "sess_save_path" is empty; using "session.save_path" value from php.ini.

6) I created the user 'skunkbot' following the install instructions. On the recover page, when I try to 'Create User' I get a new page that says 'User Creation Error - Username already in use'

'Simple Verification' returns "nobody logged in."
'Optional Login' returns page "You are not logged in but can still see this page." Login from this page returns 404 error: /index.php/login?redirect=examples%2Foptional_login_test

7) This is the last line from the CI log file when using /index.php/examples/index:

ERROR - 2017-12-06 02:16:52 --> 404 Page Not Found: Login/index

8) I added a couple more routes, but that didnt help.

So, any thoughts on what did I do or miss that was really silly?

PS I dont think it is relevant, but just in case:
localhost on xampp with mariadb - according to the xampp documentation anyway Smile


  Adding comments to fields in migrations
Posted by: quentin - 12-05-2017, 05:52 AM - Forum: CodeIgniter 3.x - No Replies

Hi,

Could we add to the CI codebase for both v.3 and v.4 the ability to add field comments in migrations. 

I use the following.  I came across this functionality while googling and have been using it for a while now, to add comments to fields in migrations.

In system/database/DB_forge.php


Code:
abstract class CI_DB_forge {

    .
    .
    .
    
    /**
     * COMMENT value representation in CREATE/ALTER TABLE statements
     *
     * @var    string
     */
    protected $_comment        = ' COMMENT ';
    
    .
    .
    .
    
    /**
     * Process column
     *
     * @param    array    $field
     * @return    string
     */
    protected function _process_column($field)
    {
        return $this->db->escape_identifiers($field['name'])
            .' '.$field['type'].$field['length']
            .$field['unsigned']
            .$field['default']
            .$field['null']
            .$field['auto_increment']
            .$field['comment'] // <-- this is the added code
            .$field['unique'];
    }

    .
    .
    .
    
    /**
     * Field attribute COMMENT
     *
     * @param    array    &$attributes
     * @param    array    &$field
     * @return    void
     */
    protected function _attr_comment(&$attributes, &$field)
    {
        if ($this->_comment === FALSE)
        {
            return;
        }

        if (!empty($attributes['COMMENT']))
        {    
            $field['comment'] = $this->_default.$this->db->escape($attributes['COMMENT']);
        }
    }

    // --------------------------------------------------------------------

    
}


To implement, in a migration execute the following:

Code:
public function up()
{
    $this->dbforge->add_field(
        array(
            'id' => array(
                'null' => FALSE,
                'type' => 'INT',
                'constraint' => 11,
                'auto_increment' => TRUE,
            ),
            'my_field' => array(
                'type' => 'VARCHAR',
                'constraint' => 30,
                'null' => FALSE,
                'comment' => 'Put the field comment here',
            ),
        )
    );
    
    .
    .
    .
    
}


  How to include footer and header in error/html/error_404.php
Posted by: amitkalhan - 12-05-2017, 01:01 AM - Forum: General Help - Replies (2)

I can print the base url at  error/html/error_404.php  by adding following code:-

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php
$ci = new CI_Controller();
$ci =& get_instance();
$ci->load->helper('url');
?>


But couldn't include my header and footer (Located at: [b]views/include/footer.php) in error/html/error_404.php[/b]


  IP to country using whois protocol
Posted by: skunkbad - 12-04-2017, 10:09 PM - Forum: Lounge - Replies (5)

I'm playing around with some code for no particular reason. Given an IP address (IP4 or IP6), it is mostly successful at determining the country. It's not super fast like using IP2Country, but it's not terribly slow. I'm wondering if any of you have experience with this, and if it's generally regarded as unreliable, or any other negative consequences. Check it out:


PHP Code:
<?php

function _request$ip$type$server )
{
    $search $type == 'registry'
        'whois:'
        'country:';

    $f fsockopen$server43$errno$errstr);

    if( ! $f )
    {
        fclose($f);
        return FALSE;
    }

    /*$ip = $type == 'country'
        ? 'n ' . $ip
        : $ip;*/

    fwrite$f$ip "\r\n" );

    $found FALSE;
    do{
        $line fgets($f1024);

       //echo $line . '<br />';

        if( stripos$line$search ) !== FALSE )
        {
            $parts explode':'$line );
            $value trim$parts[1] );
            $found TRUE;
        }
    }
    while( ! feof($f) && $found === FALSE );

    fclose($f);
    return isset( $value )
        $value
        
FALSE;
}

function 
determine_regional_registry$ip )
{
    return _request$ip'registry''whois.iana.org' );
}

function 
determine_country$ip$server )
{
    return _request$ip'country'$server );
}

$ip '204.86.16.251';   // US
$ip '209.105.243.106'// US
$ip '123.77.194.109';  // CN
$ip '188.143.234.155'// RU
$ip '61.131.86.89';    // CN
$ip '27.151.61.241';   // CN
$ip '195.154.204.88';  // FR
$ip '188.123.126.139'// GR
$ip '110.232.248.115'// IN
$ip '45.72.0.253';     // Blank ???
$ip "103.254.205.75";  // IN

if( $server determine_regional_registry$ip ) )
{
    echo $server ' says IP address ' $ip '  is in: ';
    echo determine_country$ip$server );


  Language default + languages add
Posted by: microbica - 12-04-2017, 09:46 PM - Forum: General Help - No Replies

Hello everyone
I want to install several languages, my question is
Example, i have Russian, German, English
i have
// in my English language
$ lang ['hello'] = "hello";
// in my German language
$ lang ['hello'] = "halo";
but i don't have it in Russian
Can i configure codeigniter so that if a line does not exist, i will default to English?


thanks! Big Grin

Cool Cool Cool


  Don't log 404 errors in error log
Posted by: mrtomtom - 12-04-2017, 07:35 PM - Forum: General Help - Replies (3)

On our live site we get a lot of 404 errors from our site been probed by bots looking for phpMyAdmin/wordpress etc. This is filling up our log files with loads of  "404 Page Not Found: Phpmyadmin2015/index" etc.

What's the best way to stop any 404 errors being logged into our log files?

Many thanks!


  Form validation for field create with jquery
Posted by: pippuccio76 - 12-04-2017, 03:59 PM - Forum: General Help - Replies (1)

Hi at all sorry for english, i am doing an invoice .
i have one row with input text  article name= 'article[1]' and input text quantity name= 'quantity[1]' .
With jquery i create a new row clicking a button for every click i add a row

the name of input are increase (f.e. article[2] and quantity[2] , article[3] and quantity[3])

How can i validate this value ,i want set required for this field ...



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