php - path of a script from another one -


i have structure:

-folder1    -folder2       -script1.php    -folder3       -script2.php 

now i'm trying call script1 script2:

// script2.php file_get_contents(" path ? "); 

note: path doesn't work /folder1/folder2/script1.php/. can writing plus domain name this:

http://example.com/folder1/folder2/script1.php/ 

but want know how can without writing domain name?

in script 2 can use:

file_get_contents("../folder2/script1.php"); 

or can include script 1 in script 2:

include("../folder2/script1.php"); 

better approach create class.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -