Hi all,
I read the php manual about creating images on http://www.php.net/manual/en/features.images.php and just copy and paste the code:
<?php
Header("Content-type: image/png"
$string=implode($argv," "
$im = ImageCreateFromPng("images/button1.png"
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,9,$string,$orange);
ImagePng($im);
ImageDestroy($im);
?>
and I uploaded it to my webserver to test it cause I found it a good idea to use it for page counters.
But I got the following error when I browse the file via IE:
<br>
<b>Warning</b>: imagecreatefrompng: Unable to open 'images/button1.png' for reading in <b>/path/to/the/file/CreateImage.php</b> on line <b>4</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>5</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>6</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>7</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>8</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>9</b><br>
Whats wrong? And how can I get the benefit from createImage command via php script?
And any idea how can I create a simple but strong script for page counter cause my web host's counter is realy poor cause its not storing the IP address it just count how many times the page opened.
HaVe a GooD DaY
@li
I read the php manual about creating images on http://www.php.net/manual/en/features.images.php and just copy and paste the code:
<?php
Header("Content-type: image/png"
$string=implode($argv," "
$im = ImageCreateFromPng("images/button1.png"
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,9,$string,$orange);
ImagePng($im);
ImageDestroy($im);
?>
and I uploaded it to my webserver to test it cause I found it a good idea to use it for page counters.
But I got the following error when I browse the file via IE:
<br>
<b>Warning</b>: imagecreatefrompng: Unable to open 'images/button1.png' for reading in <b>/path/to/the/file/CreateImage.php</b> on line <b>4</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>5</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>6</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>7</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>8</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/path/to/the/file/CreateImage.php</b> on line <b>9</b><br>
Whats wrong? And how can I get the benefit from createImage command via php script?
And any idea how can I create a simple but strong script for page counter cause my web host's counter is realy poor cause its not storing the IP address it just count how many times the page opened.
HaVe a GooD DaY
@li