>>>As a test to understand how to create and save a file on my server i
created the next code:
<html>
<head>
</head>
<body>
<?php
$pic = imagecreatetruecolor(100, 100);
Imagejpeg($pic,"pic.jpg");
ImageDestroy($pic);
?>
<img src="pic.jpg">
</body>
</html>
I ran this code in my development environment and it worked. I got a page
with a black square 100x100. The image pic.jpg was also saved in the same
directory as the script.
Perhaps your script does not have permission to write the file in that
directory?
Perhaps you don't actually have the GD Library installed? check phpinfo()
for the GD Section - if it isn't there, it isn't installed.
Try this php script: with no HTML
<?php
ini_set( 'display_errors', '1' );
error_reporting (E_ALL ^ E_NOTICE);
function my_error_handler ($errno, $errstr, $errfile, $errline) {
echo "In $errfile, line: $errline\n - $errstr<br>";
}
set_error_handler ('my_error_handler');
$pic = imagecreatetruecolor(100, 100);
Imagejpeg($pic);
ImageDestroy($pic);
?>
That *should* display errors to the browser if you have any, and they may
let you know why thintgs aren't working.
Michael