0

I need to transfer one php file to another folder. For example:

I have a folder naming sample inside it there are two folders naming folderA and folderB, inside folderA there is folderC and inside it there are folders 1,2 and 3 and test.php the file I need to transfer is inside folder 3... So I need to transfer it in folderB ...

I have already tried to transfer it and also I have changed the path for each include and require that I used... but still there is an error..

Fatal error: Class 'C_test' not found in /var/www/html/sample/folderA/folderC/folder3/trial.php on line 68

Class C_test is inside test.php

I think there is a problem regarding my autoload function..? here is my codes for my autoload function..

set_include_path(get_include_path() . PATH_SEPARATOR . '../../.');    

function __autoload($className){
    $filePath = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
    $includePaths = explode(PATH_SEPARATOR, get_include_path());
    foreach($includePaths as $includePath){
        if(file_exists($includePath . DIRECTORY_SEPARATOR . $filePath)){
            require_once $filePath;
            return;
        }
    }
}

I need help...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
eRzA
  • 11
  • 2
  • 1
    whats the reason to transfer the php file ? is there any specific reason ? – Arun Jun 16 '15 at 09:34
  • possible duplicate of [PHP - Move a file into a different folder on the server](http://stackoverflow.com/questions/19139434/php-move-a-file-into-a-different-folder-on-the-server) – krzysiej Jun 16 '15 at 09:37
  • Sir the reason is I need to upload that specific file to our server that is why I need to transfer it. Does it make sense? – eRzA Jun 16 '15 at 10:02

0 Answers0