CodeIgniter Forums
Including CI snippit in another site - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Including CI snippit in another site (/showthread.php?tid=39152)



Including CI snippit in another site - El Forum - 03-02-2011

[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


Including CI snippit in another site - El Forum - 03-03-2011

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


Including CI snippit in another site - El Forum - 03-03-2011

[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