• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Include external php file in controller action

#1
[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

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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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