Php Emlak Scriptindeki Problem
-
Font dosyalarına erişip erişemediğini şöyle test etsek:
header("Content-type: image/png");
$img = imagecreatefrompng("images/msn.png");
$blue_bold = imagecolorallocate($img, 39, 43, 109);
$blue = imagecolorallocate($img, 18, 21, 68);
$red = imagecolorallocate($img, 237, 12, 28);
$font1 = 'font/116.TTF';
$font2 = 'font/119.TTF';
$font3 = 'font/132.TTF';
imagettftext($img, 15, 0, 8, 25, $blue_bold, $font1, $_SESSION['MsnSupport']);
imagettftext($img, 12, 0, 8, 45, $blue, $font2, $_SESSION['MsnForSupport']);
imagettftext($img, 16, 0, 50, 70, $red, $font3, $_SESSION['ClickHere']);
imagepng($img);if( file_exists($font1) ){
echo 'font dosyası var';
}
else {
echo 'font dosyası yok';
}
$resim ='images/msn.png';
if( file_exists($resim) ){
echo 'resim dosyası var';
}
else {
echo 'resim dosyası yok';
}
Birde internette GD Library'in farklı bir derlemeyle oluşturulmasından kaynaklanabilecek sorunlardan bahsedilen yerleri gördüm; ancak detaylı bakmak için zamanım olmadı. Olmazsa bir ara da oraları inceleyebilirim (adreslerden biri bu mesela: http://forum.dreamhosters.com/troubleshooting/13390-imagettftext-why-doesnt-it-work.htm).
Kolay gelsin.
-
Msn.php dosyasına bunları ekleyip hosta şutladım da nasıl anlayacağım ki?
bu arada font klasörünün içinde 116,119 ve 132 isimli fontlarda mevcut.
-
http://www.kandiraemlak.com/msn.php
Mozilla ile baktığımda hata aldım.
echo komutuyla sonucu ekrana bastırarak görmeye çalışacaktık; ama o noktaya gelmedik. Baştaki header komutuna dikkat etmemişim :( .
Bir de böyle deneyebilirsin:
$font1 = 'font/116.TTF';
$font2 = 'font/119.TTF';
$font3 = 'font/132.TTF';if( file_exists($font1) ){
echo 'font dosyası var';
}
else {
echo 'font dosyası yok';
}
$resim ='images/msn.png';
if( file_exists($resim) ){
echo 'resim dosyası var';
}
else {
echo 'resim dosyası yok';
}
//header("Content-type: image/png");
$img = imagecreatefrompng("images/msn.png");
$blue_bold = imagecolorallocate($img, 39, 43, 109);
$blue = imagecolorallocate($img, 18, 21, 68);
$red = imagecolorallocate($img, 237, 12, 28);
$font1 = 'font/116.TTF';
$font2 = 'font/119.TTF';
$font3 = 'font/132.TTF';
imagettftext($img, 15, 0, 8, 25, $blue_bold, $font1, $_SESSION['MsnSupport']);
imagettftext($img, 12, 0, 8, 45, $blue, $font2, $_SESSION['MsnForSupport']);
imagettftext($img, 16, 0, 50, 70, $red, $font3, $_SESSION['ClickHere']);
imagepng($img); -
Kendi bilgisayarımda Xammp ile çalıştırdım; şu farkla:
<?php
header("Content-type: image/png");
$img = imagecreatefrompng("msn.png");
$blue_bold = imagecolorallocate($img, 39, 43, 109);
$blue = imagecolorallocate($img, 18, 21, 68);
$red = imagecolorallocate($img, 237, 12, 28);
imagettftext($img, 15, 0, 8, 25, $blue_bold, "fonts/116.TTF", "destur");
imagettftext($img, 12, 0, 8, 45, $blue, "fonts/119.TTF", "allah");
imagettftext($img, 16, 0, 50, 70, $red, "fonts/132.TTF", "haaa");
imagepng($img);
?>Eğer Session[] değerleri yoksa sadece msn.png açılacak.
phpinfo()
GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled Kolay gelsin.
