File linkage in PHP -


i need in linking file in php.

here looking for:

i have 2 files process.php , index.php, both placed in different directories.

this full path process.php file:

/home/happy92a/public_html/ggytg45ffs43456/wp/wp-content/themes/funizm/loginsystem/process.php 

i want require_once index.php within process.php file, how can require it, here full path of index.php:

/home/happy92a/public_html/ggytg45ffs43456/wp/wp-content/plugins/plugged/index.php 

i have tried:

dirname(__file__) gives path current file (process.php) not (index.php) want include within process.php file.

i have tried $_server['document_root'] still not work have read bad practice use server variable.

i assuming document_root @ /home/happy92a/public_html/ if using base build absolute path doing following.

require_once ($_server['document_root'] . "/ggytg45ffs43456/wp/wp-content/plugins/plugged/index.php"); 

i read not wish use document_root. can establish constant wordpress installation called wp_dir

define('wp_dir', '/home/happy92a/public_html/ggytg45ffs43456/wp/'); require_once (wp_dir . "wp-content/plugins/plugged/index.php"); 

Comments