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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -