I've posted this onto alt.php earlier and stumped all involved.
I didn't cross post for the usual reasons Anyone here got any ideas?
--------------------------------------
I am simply attempting to find my sites root directory so I can then step up
into a folder
in which I will have my INCLUDE code. This will allow me to easily refer to
my
INCLUDE code without messing about.
Now, This code...
It simply attempts to put a file into the root of my server space, and
recall it. It doesn't work.
The file write doesn't error and the file read fails without error.
Most importantly the file is nowhere to be seen!
<Added when sent to the domain provider>
--------------------------------------
I am worried the file is dropping into a space not allocated to my account
and that
this could cause you/I some problems if it were to overwrite an important
file.
--------------------------------------
</Added when sent to the domain provider>
Robertv!
<?
$file="/tempfile.test";
#write a file to the server.
$thefile = fopen($file,"w");
fwrite ($thefile,"If you see this the file was successfully written to, and
re-read from the server as filename: $file") ;
fclose ($thefile);
#read the file from the server.
$thefile = fopen($file,"r");
$readdata=fread ($thefile,100000) ;
fclose ($thefile);
#display the results.
echo "Data file when read was :<HR>";
if($readdata=="")
{echo "Data came back empty. The file could not be read, and may not have
been written."; }
{echo $readdata."</HR>" ;}
#
#
#User comments...
# $file="tempfile.test"; will write to the current directory.
# $file="../tempfile.test"; will write up one directory.
# $file="/tempfile.test"; does some crazy disappearing act.
# Server phpinfo() snip...Windows NT localhost 5.2 build 3790