Jump to content

PHP Image doesn't work


FalcoG
 Share

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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.