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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,302
» Latest member: Juls
» Forum threads: 69,808
» Forum posts: 433,071

Full Statistics

Latest Threads
HTML Table Class new erro...
Forum: CodeIgniter 4 Discussion
1 hour ago
» Replies: 0   » Views: 49
Forum Errors
Forum: Lounge
Yesterday, 05:59 PM
» Replies: 7   » Views: 193
Admin folder in subfolder...
Forum: General Help
Yesterday, 10:17 AM
» Replies: 0   » Views: 192
Image not uploading!
Forum: Lounge
Yesterday, 06:49 AM
» Replies: 0   » Views: 104
Need a coder who can work...
Forum: Jobs
Yesterday, 06:35 AM
» Replies: 3   » Views: 382
Where can I see the full ...
Forum: CodeIgniter 4 Support
Yesterday, 04:29 AM
» Replies: 1   » Views: 164
CodeIgniter Foundation in...
Forum: News & Discussion
07-14-2019, 03:00 PM
» Replies: 8   » Views: 1,680
what is the stable last v...
Forum: General Help
07-14-2019, 01:02 AM
» Replies: 1   » Views: 210
Service Interruptions Jul...
Forum: News & Discussion
07-12-2019, 12:23 PM
» Replies: 1   » Views: 949
several controller
Forum: General Help
07-12-2019, 04:48 AM
» Replies: 2   » Views: 200

 
  HTML Table Class new error!
Posted by: videoproc - 1 hour ago - Forum: CodeIgniter 4 Discussion - No Replies

Hello!

Please help! Added lines to controller method:

PHP Code:
$table = new \CodeIgniter\View\Table();

$data = array(
 
       array('Name''Color''Size'),
 
       array('Fred''Blue''Small'),
 
       array('Mary''Red''Large'),
 
       array('John''Green''Medium')
);

echo 
$table->generate($data); 

error:  Class 'CodeIgniter\View\Table' not found

What use to add?


  Admin folder in subfolder not working...
Posted by: HarrysR - Yesterday, 10:01 AM - Forum: General Help - No Replies

Hello guys,
Here's the thing.

I've created the main application in the subdomain sub.domain.com and i've placed another admin ci application in sub.domain.com/admin/.

The problem is that when i'm trying to access the subfolder what i get is a 404 error "not found" page.

Here's the .htaccess of the admin application:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]    

<IfModule mod_rewrite.c>
RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/admin/"
RewriteRule (.*) $1 [L]
#
</IfModule>

The config.php base_urls: 
Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'https://sub.domain.com/admin/';

/*
|--------------------------------------------------------------------------
| Base site url
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['front_url'] = 'https://sub.domain.com/';



And here's the routes.php (note: I've placed the controllers in subfolders):
Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
* Users login - logout
*/
$route['login']  = 'users/users/login';
$route['logout'] = 'users/users/logout';

/**
* Projects
*/
$route['projects'] = 'projects/projects';
$route['projects/new']    = 'projects/projects/new';
$route['projects/edit/(:any)']     = 'projects/projects/edit/$1';
$route['projects/(:any)'] = 'projects/projects/$1';

/**
* Posts
*/
$route['posts']    = 'posts/posts';
$route['posts/new']= 'posts/posts/new';
$route['posts/edit/(:any)'] = 'posts/posts/edit/$1';
$route['posts/(:any)']     = 'posts/$1';


/**
* Customers
*/
$route['customers'] = 'customers/customers';
$route['customers/(:any)'] = 'customers/customers/$1';
$route['customers/edit/(:any)'] = 'customers/customers/edit/$1';

/**
* Admin users
*/
$route['users'] = 'users/users';
$route['users/(:any)'] = 'users/users/$1';

/**
* Orders
*/
$route['settings/(:any)'] = 'settings/$1';
$route['settings'] = 'settings';


/**
* Redirect any URI after default url
*/
$route['pages/(:any)'] = 'pages/$1';

/**
* Any URI pass
*/
$route['(:any)'] = 'pages';
$route['default_controller'] = 'pages';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

I've searched all over the net and i cant find anything useful.. Thanks...


Rainbow Image not uploading!
Posted by: dreamweaver - Yesterday, 06:49 AM - Forum: Lounge - No Replies

PHP Code:
<div class="custom-file">
 
               <input name="image" type="file" class="custom-file-input"  id="customFile">
 
               <label class="custom-file-label" for="customFile">Choose Image</label>
 
           </div

PHP Code:
public function create_blog() 
    {
        if (!isset(
$_POST['submit']))
        {
            
$this->load->view('temp/header-short');
            
$this->load->view('admin/create_blog');
            
$this->load->view('temp/footer');
        }
        else {
            
$image $_POST['image'];
            
$head $_POST['head'];
            
$body $_POST['body'];
            
$footer $_POST['footer'];

            
$config['upload_path'] = './src/img/blog';
            
$config['upload_path'] = './uploads/';
            
$config['allowed_types'] = 'gif|jpg|png';
            
$config['max_size'] = 10000;
            
$config['max_width'] = 4000;
            
$config['max_height'] = 4000;

            
$this->load->library('upload'$config);

            if ( ! 
$this->upload->do_upload('image'))
            {
                    
$error = array('error' => $this->upload->display_errors());
                    
$this->load->view('temp/header-short');
                    
$this->load->view('admin/create_blog'$error);
                    
$this->load->view('temp/footer');
            }
            else
            {
                    
$data = array('upload_data' => $this->upload->data());

                    
$this->load->view('upload_success'$data);
            }
        }
    } 

Error message is 'You did not upload the file'.

I cannot see anything wrong.


  Forum Errors
Posted by: InsiteFX - Yesterday, 04:34 AM - Forum: Lounge - Replies (7)

Hi Jim,

The last couple of days I have been getting this error when posting a new topic.

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 's.subscriptionkey' in 'field list'

Query:
SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.subscriptionkey, 
s.notification FROM mybb_threadsubscriptions s LEFT JOIN mybb_users u ON (u.uid=s.uid) WHERE 
(s.notification='1' OR s.notification='2') AND s.tid='74052' AND s.uid != '75' AND 
u.lastactive>'1563169990'

Please contact the MyBB Group for technical support.

This has happened more then once that's why I' am bring it to your attention.


Information Where can I see the full guide ?
Posted by: Digital_Wolf - 07-14-2019, 11:53 PM - Forum: CodeIgniter 4 Support - Replies (1)

Good all !

Tell me where you can see the full guidance on these topics:
1) CSRFA simple example of how and where to use token, hash and what to compare them with.
2) Filters - example of user authentication or something like that.
and 
3) node_modules (npm packages) - how to place these modules with .js scripts in the folder ./app/* (NodeJS or other). I would not like to allow other users to access through http://site.com/node_modules/ module.js (located in the folder ./public/) because these modules are intended only for the server part.


  what is the stable last version for CI 3x ?
Posted by: agdsys - 07-14-2019, 12:24 AM - Forum: General Help - Replies (1)

greetings support, the other time ask for the updates to CI 3x versions, but today I am unable to understand what is the path you are following, could you tell me which is the current version downloadable on your official site?


  launch helpers with extern method
Posted by: arenholf - 07-12-2019, 04:15 AM - Forum: General Help - No Replies

hi everybody !

I'm new in PHP and codeIgniter and i have an issue with my code.
I'm trying to clean my view method by stocking some helpers in extern method.
So, instead to have:


    public function index(){
  
        $this->load->helper('url');
        $this->load->helper('form');
        $this->load->model('Users_model');
       
        $data['records'] = $this->Users_model->getData();

        $this->load->view('templates/header');
        $this->load->view('users', $data);
        $this->load->view('templates/footer');
}

i want to do this:

 public function index(){
  
        loaderMethod();
       
        $data['records'] = $this->Users_model->getData();

        $this->load->view('templates/header');
        $this->load->view('users', $data);
        $this->load->view('templates/footer');
}

    public function loaderMethod(){
        $load = array(
            "$this->load->helper('url');",
            "$this->load->helper('form');",
            "$this->load->model('Users_model');"
        );
        return $load;
    }

i know that stocking these ligns in an array it's a bad idea, but it was for show you that i'm trying to do.
If u have some ideas to give, it will be a pleasure ! Big Grin


  several controller
Posted by: keiralittle - 07-12-2019, 03:15 AM - Forum: General Help - Replies (2)

Hi , sorry for english , in every controller i have :

Code:

Code:
       $this->load->view('templates/header_user',$data);
       $this->load->view('templates/menu_user',$data);
       $this->load->view('controller/view', $data);
       $this->load->view('templates/footer_user',$data);


Because menu_user are used in several controller  and i want send a value  to menu , how can i do this ?


  Help, How to fix Codeigniter 404 response status with content on specific case
Posted by: juankav89 - 07-11-2019, 04:32 PM - Forum: General Help - Replies (1)

I have a codeigniter project that return only in some case 404 header response, but with controller response.

Problem affect SEO score and page not load on Microsoft browsers.

Its Codeigniter 3.0.3 on cloudways server instance with apache PHP 5.6.  I try fix changed htaccess rules (i am newbie with that), and force header status 200 before execute load view code, but header status not change.

**CODE INFORMATION**

This its .htaccess::
```
<IfModule mod_rewrite.so>
   RewriteEngine On

   RewriteCond $1 !^(index\.php|images|stylesheets|javascript)
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*) /index.php/$1 [L]
   RewriteRule ^uploadify/.*$ - [PT]
   RewriteRule ^uploads/.*$ - [PT]

</IfModule>

<IfModule !mod_rewrite.so>
      ErrorDocument 404 /index.php
</IfModule>

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
```

routes.php fragment:
```php
$route['default_controller']        = 'apply'; // working
$route['apply-mortgage']            = 'apply/mortgage';  // not working
```

Same functions (index and mortgage) return a respective views with same code:
```
 $this->load->view();
```
I include MY_CONTROLLER too:
```php
class MY_Controller extends CI_Controller {
  public function _remap($method, $params = [])
  {
    if (method_exists($this, $method)) {
      $response = $this->$method(...$params);
      if ($response === null) {
        $response = Response::LAST();
      }
      if ($response instanceof stdClass || in_array(gettype($response), ['array', 'boolean', 'double', 'integer'])) {
        $response = Response::json($response);
      } elseif (is_string($response)) {
        $response = Response::html($response);
      }
      if ($response instanceof Response) {
        $response->output();
        exit;
      }
      if (isset($response)) return $response;
    }
    show_404();
  }
}
```

**BROWSER RESPONSE**

Actual response on browser console
header (network tab)
```
Confusedtatus: 404
Content-Type: text/html; charset=UTF-8
Pragma: no-cache
. . .
```
preview (network tab) return view response on controller function:
```
<!doctype html>
<html lang="en">
<head>
...
```

I need that header response status return 200


  Transaction system
Posted by: vincent78 - 07-11-2019, 07:19 AM - Forum: General Help - No Replies

I've got a question about the Transaction system
and more precisely, about the trans_rollback() method in a nested transaction

I looked at the code in the DB_driver.php file and it seems that in a nested transaction, a trans_commit() call does the same job than a trans_rollback() call : it just decrements the _trans_depth counter
I agree for the trans_commit() method but for the trans_rollback() method, I expected a rollback for the main transaction

How can I really rollback when I rollback in a nested transaction ?



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