Matt -- ...and then Matt Babineau said... % % Hi everyone:
Hi!
...
%
% I am working on a website, and I have a shared hosting account on a
% win2k machine. When I upload from my local machine to the shared hosting
% machine I have to change a variable on each of my pages that gives me
% the proper path to including the necessary files to execute the page
% properly. If I don't I get an error.
What I've done is put a bit of code in each of my scripts
# this will let us figure out where we are and then always source the right include
stuff!
# it does not work with symlinks (__FILE__ reports the *target*)
# you must have a full env tree in your devel tree; we now look exclusively in
$DEVELDIR if set
if ( ereg("/home/sites/\.php/",__FILE__) ) # are we *somewhere* in our
usual master tree?
{ $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; }
# get the working dir
and then I work from my base development tree with a
include("/home/sites/.php$DEVELDIR/includestuff.inc"); # include our various
files
require("/home/sites/.php$DEVELDIR/ImageInformation.class.php");
and away I go. I replicate my build directory anywhere under the .php
dir and everything else knows where it is and thus where to find the
other files in the same version.
This may be helpful; good luck!
HAND
:-D
--
David T-G * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg88211/pgp00000.pgp
Description: PGP signature

