In reply to:
But i don't know how to make it works in dreamhost, i try everything i know, and nothing works.
The script code is :
http://www.activeunit.com/scripts/watermark.zip
Could someone take a look in this script please?
Played with it; Don't think it's gonna work if you're using PHP as CGI. Not even sure how to revert PHP to Apache module, or even if it's offered.
One thing for certain that I noticed is the path info is missing; i'd replace
$dr=preg_replace('/modify.php.+/', '', $_SERVER['PHP_SELF']);
$filename=str_replace($dr, './', $_SERVER['PATH_INFO']);..with:
$dr=preg_replace('/modify.php.+/', '', $_SERVER['PHP_SELF']);
$filename=$_SERVER['DOCUMENT_ROOT'].$dr;..for starters.
Aside from that, there's a workaround for this that you can employ; simply modify this code to accept a query-string argument for a file name and keep all of the images in a fixed, separate directory that you have "access deny all" set in .htaccess; that way the PHP script should be able to access its files while the httpd won't allow it to be linked.
Alternatively, if you're feeling lazy and ya got a few $$ burning a hole in yer pocket and ya want my Rent-a-Coder account name, just lemme know.