I'm trying to create a set of reusable objects to use in my websites. No problem as far as the coding, but I'm confused by absolute and relative path names.
I get the $SERVER['DOCUMENT_ROOT'] business, and I can move up a level with ../ .
This code: " $action = $_SERVER['DOCUMENT_ROOT'] . "/tools/add_image.php";" produces a 404 error. (But the file does actually exist at the path specified.)
Modifying it thusly: "$action = "/tools/add_image.php"; works from one directory, but not from another further down the tree. That needs $action = "../tools/add_image.php";
I need to call a POST from somewhere down the tree and have it directed to a page at the document root.
How do I consistently access a file at the document root, or even better, a library folder even further up the tree?