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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,299
» Latest member: scoffield_1
» Forum threads: 69,926
» Forum posts: 359,815

Full Statistics

Latest Threads
Routes- Today i died
Forum: Installation & Setup
3 hours ago
» Replies: 5   » Views: 109
Best way to use db table ...
Forum: CodeIgniter 4 Support
4 hours ago
» Replies: 1   » Views: 88
Codeigniter 4 Modules not...
Forum: CodeIgniter 4 Support
4 hours ago
» Replies: 0   » Views: 32
Removing index.php not wo...
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 3   » Views: 67
Get today's posts
Forum: General Help
6 hours ago
» Replies: 10   » Views: 203
Auto refresh data through...
Forum: General Help
6 hours ago
» Replies: 3   » Views: 57
CodeIgniter appears to ha...
Forum: General Help
6 hours ago
» Replies: 2   » Views: 124
Empty entity attributes
Forum: CodeIgniter 4 Support
6 hours ago
» Replies: 2   » Views: 73
How to load Configuration...
Forum: CodeIgniter 4 Support
7 hours ago
» Replies: 1   » Views: 55
Insert binary value into ...
Forum: General Help
8 hours ago
» Replies: 4   » Views: 834

 
  Codeigniter 4 Modules not working properly
Posted by: unromantic - 4 hours ago - Forum: CodeIgniter 4 Support - No Replies

I have been trying to setup codeigniter 4 modules but it seems something is not working properly it takes me to 404 or not found.

I have simply installed Ci4 and follow this doc did not tweaked anything else as we do in previous ci 3 hmvc practice.
is there anything else beside autoload ? I'm basic php dev. please guide.
thanks


  Removing index.php not working on hosting althougt all conditions true
Posted by: futureisnow - 8 hours ago - Forum: CodeIgniter 4 Support - Replies (3)

Hi, 
first of all I know that is a famous problem and I have already tried probably everything and I am just tired after 4 days of fighting. I feel stupid asking that as the next but I am really desperate.

The thing is: 
Removing index.php from URL works fine on localhost (XAMMP) but does not work on hosting (OVH, Apache) i.e. http://example.com/index.php/contact works fine while http://example.com/contact does NOT work.

On the server I set "root folder" into "public" folder and it seems working.

My application is:

  1. Manually installed CI4 RC1
  2. One dummy view added (contact.php) to test url + its routing 
  3. App.php: 
  • $baseURL = "http://example.com/" 
  • $indexPage = ''

The original .htaccess in "public" folder didn't work on the hosting.

A dummy .htaccess like:

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

...also does not work (neither in "public" nor in "/" folder).

I can see only a message "File not found." when I choose 


Important is that my hosting provider told me "rewrite_mod" work correct on the server.

Does anybody know what problem can be?

Should .htaccess be placed in "public" or in "/"?

Best Regards!


  Auto refresh data through Model
Posted by: AngelTrader - 9 hours ago - Forum: General Help - Replies (3)

HI Everyone

i'm totaly new to MVC programming and CodeIgniter, so please forgive me for basic question. I couldn't figure it out myself.

I have a controller called "dashboard.php"
I have a model called "members_model.php"
I have a view called "dashboard_view.php"

In my controller I call :
    $this->load->model('members_model');
    $resultdata["membersTotal"] = $this->members_model->Get_Total();

The Get_Total() function returns me a number.
Inside my dashboard_view I have a <div id="membertotal"> in which I echo out $membersTotal and this works fine.

However, now I want to refresh that data in that <div> every 5 seconds.
I know I need to do an AJAX call , but how do I call that model dashboard_model.php to retrieve the new value ?

Hopefully it's somewhat clear, thanks guys!


  Database Backup With Bulk Insert Query
Posted by: derekyaze - 10 hours ago - Forum: General Help - No Replies

Creating database backup is very easy but I need to create db backup with bulk insert sql query. It reduces created backup file. Anyone knows about solution?

I have used following code and creates db backup successfully but I need to have SQL file with bulk insert sql query.

$this->load->dbutil(); 

$prefs = array(
'format' => 'zip',
'filename' => 'my_db_backup.sql'
);

$backup =& $this->dbutil->backup($prefs);
$db_name = 'backup-on-'.date('Y-m-d').'.zip';
$save = 'assets/db_backup/'.$db_name;
write_file($save, $backup);
force_download($db_name, $backup);


Thanks in advance.


  How to load Configuration Files as Array?
Posted by: bustersg - 11 hours ago - Forum: CodeIgniter 4 Support - Replies (1)

I am passing some environment settings to a view template but how do I pass it as an Array to avoid below error?

TypeError
Argument 2 passed to view() must be of the type array, object given

PHP Code:
<?php namespace Config;

use 
CodeIgniter\Config\BaseConfig;

class 
TestConfig extends BaseConfig
{
    /*
    |--------------------------------------------------------------------------
    | CAPTCHA
    |--------------------------------------------------------------------------
    |
     */
    public $captcha 1


PHP Code:
// Access config class with namespace
$config config'Config\\TestConfig' );

echo view('login', $config); 


  Access-Control-Allow-Origin
Posted by: carmine.milieni - Today, 08:59 AM - Forum: CodeIgniter 4 Support - No Replies

I have create RESTfull server in codeigniter 4, my ci4 app It is performed on fake virtual host, example api.fakedomain.it, if i execute request from my REST client don't have problem, but if execute request call from my angular app to http://localhost:4200/ , i receive on browser debug console this error

Code:
login:1 Access to XMLHttpRequest at 'http://api.fakedomain.it/api/v1/authentication' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

How can i configure CI4 ? thanks


  Mongodb error in php 5
Posted by: omid_student - Today, 08:18 AM - Forum: General Help - No Replies

Hi
I try use mongodb library in codeigniter and it is working on localhost on php 7.3
but when i run it on my host with php 5.6,i have error
'Insert of data into MongoDB failed: No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling ismaster on '185.88.179.86:27017']

While it is OK on localhost

I enabled Mongodb extension on host and not problem in extension
I use below library for codeigniter
https://github.com/intekhabrizvi/Codeign...go-library

Please help me


Question Empty entity attributes
Posted by: Asteria - Today, 07:39 AM - Forum: CodeIgniter 4 Support - Replies (2)

Faced a problem, I can not get data from the entity. For example,

Code:
$user_entity->username
always returns NULL. When viewing the entity obtained through Kint debug, my data is visible in the attributes. Also, when using getters or setters of an entity, I constantly get an error
Quote:Call to a member function test_func () on array

An entity object is returned by the model. I did everything according to the CI4 documentation, but ran into such a problem. What are the options?


  Routes- Today i died
Posted by: 5flex - Today, 07:13 AM - Forum: Installation & Setup - Replies (5)

Hello Dev's! Today i died!

Sorry for my bad English, I'm from Russia. I will try to write about my problem and tell you that I'm furious!  Angry Angry Angry

Today at early morning I power on my PC and start to read WEB about PHP Frameworks. I read a lot of articles. Very many. 

A lot of developers recommend CI as the easiest and most convenient framework with good documentation, simple code, and most importantly rich functionality. I downloaded it, installed it, and started writing code. In the directory / controller, I immediately created my directory / public and put there my START FILE, which, as I thought, would be the default controller. In write rule for route - $route['default_controller'] = 'public/homepage'; But! I always get 404 error. I read the documentation. Again. Once again. And more and more and more. I looked at hundreds of sites, asking how to make the default controller from a subdirectory .... I spent ALL DAY on it and read with tears in my eyes that CI does NOT support this feature! how? How? HOOOOOOOOOOOOOOOOOOOW CAN IT BEEEEEEEEE ?!!!!!!!!!! This is unbelievable! Such a simple thing and so many problems! What is the problem of realizing such an opportunity out of the box?

Now one and the same thought is spinning in my head ... How can I start building a new project on such a “cool” framework if I already encountered a problem at the INITIAL stage, the solution of which took a WHOLE DAY! What awaits me ahead? I don’t know .... Today I died. Huh Huh Huh


  CodeIgniter appears to have a BUG.
Posted by: christaliise - Today, 03:47 AM - Forum: General Help - Replies (2)

This is the coding in the Controller;

PHP Code:
public function index()
{
    
$error 0;
    
$realname "";
    
$username "";
    
$word "";

    
$this->load->helper(array('form''url','file'));
    
$this->load->library('form_validation');

    
$config = array(
    array(
'field' => 'rname''label' => 'RealName''rules' => 'required''errors' => array( 'required' => 'Provide%s')),
    array(
'field' => 'uname''label' => 'Username''rules' => 'required''errors' => array( 'required' => 'Provide%s')),
    array(
'field' => 'word''label' => 'Word''rules' => 'required''errors' => array( 'required' => 'Provide%s')));

        
$this->form_validation->set_rules($config);
        if (
$this->form_validation->run() == FALSE)

            {
            
$this->load->view('names');
            }

        
$realname $this->input->post('rname');
        
$username $this->input->post('uname');
        
$word $this->input->post('word');

        if(!
file_exists("C:xampp/htdocs/file1/$realname")) exit ("$realname DoesNotExist");
        if(!
file_exists("C:xampp/htdocs/file2/$realname/$username")) exit ("$username DoesNotExist");
        if(!
file_exists("C:xampp/htdocs/file3/$realname/$word")) exit ("$word DoesNotExist");

        if(isset(
$_POST['submit'])) redirect(BASE_URL.'home');


If I comment out by //if(isset.. the form validation works OK but I need the "isset" for the other coding to work.

There are two functions in the coding above, one ensures the text boxes are filled in and not left empty (form validation), and the other ensures the text boxes are filled in correctly (if !file_exits). Both functions work good individually but they wont work together.

In other words if I run the code and one box is empty and not validated that redirects when it shouldn't. Validation should stop the redirecting when a box is empty.

It appears to be a bug in CodeIgniter that has not yet been detected.

Maybe some change within CodeIgniter's system file may fix both functions to work together.



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