Jump to content

Why is the image broke?


3raser

Recommended Posts

I'm starting to learn the image related functions with PHP. And I can't seem to get this image to work properly:

 

<?php
//set our page to display an image
header ('Content-Type: image/png');
            
//create our image
$img = @imagecreatetruecolor(450, 120);

//create our white color
$white = imagecolorallocate($img, 255, 255, 255);

//create our string
imgagestring($img, 1, 150, 60, 'Test', $white);

imagepng($img);
imagedestroy($img);
            
?>

 

All I get is the img doesn't exist icon: http://osremake.org/test/index.php

 

I've even looked up in the PHP manual to see if I'm doing anything wrong. :/

Link to comment
https://forums.phpfreaks.com/topic/259098-why-is-the-image-broke/
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.