So I have an issue with wordpress php includes after I’ve made an app via cordova for iOS. Basically, the code I have on the live website right now is:
include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/wp-includes/wp-db.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/wp-includes/class-phpass.php');
However this only works live. When I make the app, $_SERVER['DOCUMENT_ROOT']
does not return the correct path to include the file I need. What path can I use to make sure these wordpress files are included in my external php file?
Thanks!
I found out that the answer to this was to echo
$_SERVER['DOCUMENT_ROOT']
in a test php file and it came back with my root path, this allowed me to change it accordingly and it then worked remotely and not just locally.Thanks for the help!