包括codeIgniter中外部脚本的控制器文件

时间:2012-10-14 16:04:29

标签: php codeigniter uploadify

我有以下目录结构。

application
| 
| -----> controller
            |
            | ------> profie_control.php
assets
|
| ------> Others 
             |
             |---> uploadify 
                     |
                     | --> uploadify.php

现在我的uploadify.php我正在做我想要执行的所有事情。然后在完成所有事情之后我想调用一个函数并在profile_control.php中将数据传递给它。现在我不知道如何访问这些功能。 我尝试使用以下代码

include_once("http://localhost/php/ci/index.php/profile_control/myfunction");
uploadify.php中的

但是它给了我以下错误

Warning: include_once() [function.include-once]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\wamp\www\php\ci\assets\Others\uploadify\uploadify.php on line 8

我在一些论坛上读过这种方法并不好,因为它可能导致安全问题。现在我如何安全地将数据从uploadify.php发送到profile_control.php或者更好的替代方案???

1 个答案:

答案 0 :(得分:0)

您不能通过URL包含/要求,但您可以按路径包含/要求,这就是您要执行的操作。在您的控制器中:

include_once("../../assets/Others/uploadify/uploadify.php");
some_func(); // function from file 'uploadify.php'
相关问题