crazy.works
03-25-2010, 02:29 AM
hello, i wanna include php file in one script of mine from another server without getting bugs in my script.
inside that php file some important functions that i can't put in the same place with the script in the same server, and that is why i upload the file in other server and i include it inside the script...
i did some more work on this thing in the last few days and here is what i ended with:-
1. i can include the php file from the server "A" into my script in server "B", by using include("http://site.com/path/file.php"); and editing php.ini with setting allow_url_include = On
2. when i include the php file from another server, it works find but the functions and the classes doesn't work.
3. to get the access to the functions and the classes, i have to include the file with a different extension - such as '.inc' This way the php interpreter will not 'get in the way' and the text will be included normally.... so i have to include the file like this include("http://site.com/path/file.inc");
4. i get huge problem by renaming the file in server "A" from 'file.php' to 'file.inc', because the server will consider it as a text and it will be viewable as a text in any browser !!
so please anybody got any idea about how to get access to the functions and the classes without renaming the file extension ??? or anybody know good idea to make the file non-viewable in the browsers after renaming it to file.inc ???
inside that php file some important functions that i can't put in the same place with the script in the same server, and that is why i upload the file in other server and i include it inside the script...
i did some more work on this thing in the last few days and here is what i ended with:-
1. i can include the php file from the server "A" into my script in server "B", by using include("http://site.com/path/file.php"); and editing php.ini with setting allow_url_include = On
2. when i include the php file from another server, it works find but the functions and the classes doesn't work.
3. to get the access to the functions and the classes, i have to include the file with a different extension - such as '.inc' This way the php interpreter will not 'get in the way' and the text will be included normally.... so i have to include the file like this include("http://site.com/path/file.inc");
4. i get huge problem by renaming the file in server "A" from 'file.php' to 'file.inc', because the server will consider it as a text and it will be viewable as a text in any browser !!
so please anybody got any idea about how to get access to the functions and the classes without renaming the file extension ??? or anybody know good idea to make the file non-viewable in the browsers after renaming it to file.inc ???