bradgrafelman;10953316 wrote:Why does it break your script? Can you show us how you're using it where it breaks?
DOH -- forgot to do that.
I have, for example, the following code:
$_SESSION['SiteRootHTML'] = dirname($_SERVER['SCRIPT_NAME'])."/";
$_SESSION['ThemesLocHTML'] = $_SESSION['SiteRootHTML' ]."site/Themes/";
echo $_SESSION['SiteRootHTML']."<br/>;
echo $_SESSION['ThemeLoc'];
With the trailing slash tacked onto the first variable, on my local machine the echo statements produce:
/accardi/
/accardi/site/Themes/Board-n-Parchment/
which is fine. On the live site, the same code produces:
//
//site/Themes/Board-n-Parchment/
which is broken. On the live site I have to omit the trailing slash. Omitting the slash on my local site, the second echo then produces:
/accardisite/Themes/Board-n-Parchment/
which breaks the local site.
I know my webhost runs Apache 1.3/PHP 5.2, while I'm running 2.2/5.3. Is that significant? On both sites, the website sits in subdir /accardi off document root, however, given the different values of $_SERVER['SCRIPT_NAME'] between sites, I'm assuming a virtual host must be configured on the live site (I haven't look at httpd.conf there, because I haven't found it yet).
It's not really a big deal having to add the / before uploading, but it'd be nice to fix it.
--Nathanael