Forum Moderators: coopster
This is the second question i (still) have, not sure if thats permitted?
Ime trying to update a file: /updates/updates.txt , from /modify/modified.php
finding the root is my problem,
i cant use phpinfo() on my site, so had to call them for my path: something like this: ext/m/mysite/html
i've tried;
fopen("/ext/m/mysite/html/updates/updates.txt","r+")
fopen($_SERVER["document_root"]."updates/updates.txt","r+")
and some variations on these, the root_path problem is often discussed on the net, but mainly for include :S
thnx again!
Though your code will still now work as DOCUMENT_ROOT does not have a trailing slash and is uppercase.
Ie:
fopen($_SERVER["document_root"]."updates/updates.txt","r+")
should be
fopen($_SERVER["DOCUMENT_ROOT"]."/updates/updates.txt","r+")
daisho.
sorry for not capping my document_root :S
when i do: echo $_SERVER['DOCUMENT_ROOT']
the echo = /ext/default
i tried applying this like below;
fopen($_SERVER['DOCUMENT_ROOT']."/m/mysite/html/update/updates.txt"."r");
Again, No Go?
[edited by: xray012 at 8:09 pm (utc) on Dec. 16, 2003]
since phpinfo didn't work i had to call my isp, the full path to the root should be:
/ext/m/mysite/html
the doc_root echo resulted: ext/default?
after trying various variations, i got a error report once, in this report i saw a complete different path someting like this: /mnt/..and..then..some
i'me totaly confused?!
<?php
$upd = fopen($_SERVER['DOCUMENT_ROOT']."/m/my-site/html/update/new-updates.txt","r+");
$output2="$datum¦data¦data";
echo "upd = $upd" ;
fwrite($handle2, $output2);
?>
resulted in:
Warning: fopen(): open_basedir restriction in effect. File(/ext/default/m/my-site/html/update/new-updates.txt) is not within the allowed path(s): (.) in /mnt/storage2/m/my-site.nl/html/pics/foto-install.php
the attributes on the update folder: 755
the attributes on the new-updates.txt: 766
[ i know:handle2 should be upd ;) ]
?in the error-path ".nl" suddenly appears , could this be a totaly different path?
ive also tried applying it to the code above.
even more confused!!?