我最後的問題是繁忙,所以我必須打開一個新的。 (閱讀我最後一個問題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