Jump to content

PHP Image doesn't work


FalcoG

Recommended Posts

I just started with php and made an image. But when I try to open it in my browser, it shows a broken image icon. I have put the font in the same folder as the .php file, but it doesn't work. Can somebody help me solve this problem?

 

Here is the code:

<?php
$font_path = "nakedchick.TTF";
$font_size = 30;

$img_number = imagecreate(300,50);
$backcolor = imagecolorallocate($img_number,0,162,255);
$textcolor = imagecolorallocate($img_number,255,255,255);

imagefill($img_number,0,0,$backcolor);
$number = " So your ip is $_SERVER[REMOTE_ADDR]? ";

ImageTTFText($img_number, $font_size,10,5,5,$number,$font_path,$textcolor);

header("Content-type: image/png");
imagepng($img_number);
?>

 

And also the files: (.php in attachment)

http://falcogerritsjans.nl/u/signature2.php

http://falcogerritsjans.nl/u/nakedchick.ttf

17912_.php

Link to comment
https://forums.phpfreaks.com/topic/259904-php-image-doesnt-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.