[PHP] Newbie - create image error URGENT

2002-05-17 Thread Dani

Hi everyone!

I'm still learning PHP and MYSQL using windows98, MYSQL, PHP 4 in my
local hard drive.

I want to learn uploading image and resizing image in my local machine.

when I execute this code:

?PHP
//setup image
$height = 200;
$width = 200;

$im = ImageCreate($width,$height);
$white = ImageCreateAllocate ($im, 255, 255, 255);
$black = ImageCreateAllocate ($im, 0, 0, 0);

//Draw on image
ImageFill($im, 0, 0, $black);
ImageLine($im, 0, 0, $width, $height, $white);
ImageString($im, 4, 50, 150, Sales, $white);

//output image
Header (Content-type: image/png);
ImagePng ($im);

//Clean up
ImageDestroy($im);

I get error message: Fatal error: Call to undefined function:
imagecreate() in D:\graphic_practise\index.php on line 15

What did I do wrong?

any advice/ help is greatly appriciated.

Thanks,

Ardani




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Newbie - create image error URGENT

2002-05-17 Thread Scott Hurring

Probably don't have the GD extension enaabled.

On a win machine, it's easy, look in your php.ini
and set the extensions_dir to where your extensions
are then un-comment php_gd.dll

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

 -Original Message-
 From: Dani [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 17, 2002 7:40 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Newbie - create image error URGENT
 Importance: High
 
 
 Hi everyone!
 
 I'm still learning PHP and MYSQL using windows98, MYSQL, PHP 4 in my
 local hard drive.
 
 I want to learn uploading image and resizing image in my 
 local machine.
 
 when I execute this code:
 
 ?PHP
 //setup image
 $height = 200;
 $width = 200;
 
 $im = ImageCreate($width,$height);
 $white = ImageCreateAllocate ($im, 255, 255, 255);
 $black = ImageCreateAllocate ($im, 0, 0, 0);
 
 //Draw on image
 ImageFill($im, 0, 0, $black);
 ImageLine($im, 0, 0, $width, $height, $white);
 ImageString($im, 4, 50, 150, Sales, $white);
 
 //output image
 Header (Content-type: image/png);
 ImagePng ($im);
 
 //Clean up
 ImageDestroy($im);
 
 I get error message: Fatal error: Call to undefined function:
 imagecreate() in D:\graphic_practise\index.php on line 15
 
 What did I do wrong?
 
 any advice/ help is greatly appriciated.
 
 Thanks,
 
 Ardani
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php