Welcome Guest, Not a member yet? Register   Sign In
Including CI snippit in another site
#1

[eluser]suppster[/eluser]
I would like to include a CI comment form in selected pages in an existing non CI site. I've tried using

Code:
$_SERVER["REQUEST_URI"] = "cms/2";

//Set GET action,method params etc

require_once "path/to/index.php";

in a file in the codeigniter root directory, but get the following error:

Quote:Fatal error: ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in C:\xampp\htdocs\web\codeigniter\system\core\Exceptions.php on line 166

But when I include the above code in a file outside the codeigniter root I get
Quote:Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

Any ideas? Thanks
#2

[eluser]suppster[/eluser]
Can anyone help with this? I'd like to include a codeigniter snippit in a different site. Thank you!
#3

[eluser]suppster[/eluser]
It was a relative path problem. The included file obviously uses the path of the calling function. I just needed to include

$application_folder = dirname(__FILE__)."/application";
$system_path = dirname(__FILE__)."/system";
in index.php




Theme © iAndrew 2016 - Forum software by © MyBB