$_SERVER['DOCUMENT_ROOT']

    Date: 12/28/07 (PHP Community)    Keywords: php, mysql, sql

    hello everyone. after a couple of training classes, i felt i was ready to repair my first php/mysql site. anyway, when i downloaded the site to my machine for testing. these little things started causing problems on my testing server:

    require_once ($_SERVER['DOCUMENT_ROOT'].'/Connections/foo_db.php');

    the $_SERVER['DOCUMENT_ROOT'] on the site, of course, takes you back to the root of the whole server and then gets the file from the folder you requested. on my testing server it goes all the way back to the C drive, i.e., it won't find: C:/wamp/www/Connections/foo_db.php because it's going too far back. is there any way to set up my testing server so it assumes a certain folder is the root? i don't feel like going through and changing all the requires and includes. thanks.

    x posted in php_mysql

    Source: http://community.livejournal.com/php/606507.html

« Multiple source files for... || Weird PHP Issue »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home