I'm using Codeigniter and facing the following problem.
In a controller, I want to include in some way an application (Not written in Codeigniter) in my controller. I am using file_get_contents now. It's working fine and the application is shown in the controller I made. The problem is, the application contains a lot of forms which are posted to other pages in the application itself. Using file_get_contents, the forms redirect the user to a target outside my controller. This may sound a bit vague, so here's an example:
The user navigates to the controller: 'game/login' and therefore wants to visit the login page. The user fills in the form. The form posts the data to assets/game/index.php?page=login. This makes the user redirect to assets/game/index.php?page=login, and therefore making him leave the controller page.
Does anyone have an idea on how to fix this problem?
defined('BASEPATH') OR exit('No direct script access allowed');
class Game extends CI_Controller{
public function __construct(){
parent::__construct();
}
public function index($page = ''){
file_get_contents(FCPATH . 'assets/game/index.php?page=' . $page);
}
}