CodeIgniter Forums
Include external php file in controller action - 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: Include external php file in controller action (/showthread.php?tid=20660)



Include external php file in controller action - El Forum - 07-17-2009

[eluser]zombica[/eluser]
Hi ,
Is there any way that i can include an external file place at root from controller action.

Here is my code
Code:
function error_template($msg_id){
    $message="";
    if($msg_id=="usr_resume"){
    $message="User Account Resumed Sucessfully.";    
    }
    if($msg_id=="usr_create"){
    $message="User Account Created Successfully. Mail send to the registered person.";
    }
    if($msg_id=="usr_edit"){
    $message="User Account Updated Successfully.";
    }
    if($msg_id=="usr_delete")
    $message="User Account Deleted Successfully.";
    }
    if($msg_id=="usr_status"){
    $message="User Account Status Changed Successfully.";
    }
    $url="../../";
    include base_url().error_template/error_template.php';
    }

What i am lacking over here
CI throws me this error.
Code:
A PHP Error was encountered

Severity: Warning

Message: include() [function.include]: URL file-access is disabled in the server configuration

Thanks in advance.
Regards,
Zombica


Include external php file in controller action - El Forum - 07-17-2009

[eluser]Phil Sturgeon[/eluser]
Your error told you the problem here.

You cannot include via a URL. Instead of bath_url() use BASEPATH.