我最后的问题是繁忙,所以我必须打开一个新的。 (阅读我最后一个问题here)。 即时尝试将请求重定向到watermark.php
文件以将徽标嵌入到从我的网站外部调用的图像中。但是当我使用htaccess的文件验证码:水印通过php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !localhost [NC]
RewriteCond %{HTTP_REFERER} !friendlysite\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule (.*) /watermark.php?pic=$1
而这些对于watermark.php:
<?php
// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('tbwm.png');
$im = imagecreatefromjpeg($_GET['pic']);
// Set the margins for the stamp and get the height/width of the stamp image
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
// Copy the stamp image onto our photo using the margin offsets and the photo
// width to calculate positioning of the stamp.
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
php文件只显示IMG文件的ALT标签,并返回该错误: The requested URL /watermark.php was not found on this server.
和当我直接打开watermark.php这个错误返回: The image http://192.168.1.190/hotlinking/watermark.php cont not be displayed because it contains errors.
最新问题?
你的意思是“php文件只显示img文件的alt标签”? – giorgio 2012-01-28 11:59:18
哼哼mm,看看这个:'。访问w3获取更多信息@'http:// www.w3schools.com/tags/att_img_alt.asp' – bizzr3 2012-01-28 12:04:35