I'm having a problem with some simple code:
<html>
<body>
<?php
header("Content-type: image/png");
$im = imagecreate(200, 200);
$green = imagecolorallocate($im, 0, 255, 0);
imagefill($im, 0, 0, $green);
imagepng($im);
imagedestroy($im);
?>
</body>
</html>
When I view the page, I get "‰PNG
IHDRÈÈ—–<ÝPLTEÿ4^À¨IDATxœ*Áà ùS_áU|PÚ
ùIEND®B`‚ "
I've isolated the problem to be with the imagepng($im); line. Any
suggestions? Thanks. 2 2123
*** gr********@hotmail.com escribi/wrote (2 Feb 2005 11:18:15 -0800): I'm having a problem with some simple code:
<html>
<body>
<?php
header("Content-type: image/png");
You start sending HTML (text/html) and then tell the browser to handle it
as an image (image/png). Whatever you do next, it can't work.
--
-+ lvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzn
-+ Send your questions to the group, not to my mailbox
--
thanks - works great now! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joshua Beall |
last post by:
According to the PHP manual, imagejpeg and imagepng have a return value of
type "int" - but I do not see where it says what the values mean. Can
anyone enlighten me?
Here are the manual pages:...
|
by: Phil Powell |
last post by:
if ($this->isSuccessful && !$hasMogrified) {
// SMACK IT ALL TOGETHER
@imagecopyresampled($newImage, $image, $config,
$config, 0, 0, $config, $config,
$origWidth, $origHeight);
// SAVE TO FILE...
|
by: David |
last post by:
Hi,
I am trying to create a two way association between 2 objects. I
intended to do it by having a pointer to each other but I am getting
compilation errors.
At the moment I can create both...
|
by: Steven T. Hatton |
last post by:
27.4.2.1.4 Type ios_base::openmode
Says this about the std::ios::binary openmode flag:
*binary*: perform input and output in binary mode (as opposed to text mode)
And that is basically _all_ it...
|
by: Yeow |
last post by:
hello,
i was trying to use the fread function on SunOS and ran into some
trouble.
i made a simple test as follows:
i'm trying to read in a binary file (generated from a fortran code)
that...
|
by: wwj |
last post by:
void main()
{
char* p="Hello";
printf("%s",p);
*p='w';
printf("%s",p);
}
|
by: anirudhvr |
last post by:
Hi,
I needed a basic binary to ascii encoder, so I wrote this piece of
code:
/*
Encoding algo: suppose 11111010 is the byte to be encoded.
It is first broken up into two 4-bit parts (1111...
|
by: shotokan99 |
last post by:
i have this issue:
showpic.php
================================================
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch,...
|
by: David Mathog |
last post by:
In the beginning (Kernighan & Ritchie 1978) there was fprintf, and unix
write, but no fwrite. That is, no portable C method for writing binary
data, only system calls which were OS specific. At...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
| |