Reply to Re: Mixing Php's imagecopy and HTML

Your name:

Reply:


Posted by David Wahler on 01/25/06 18:59

Ubantu Rococo wrote:
> Thanks mate.
> I've tried it, but the getWorldMap() function doesn't seem to work! I either
> get the raw binary data of the jpg
> and an error about the header (if I leave the header(...) function in
> below), or just the raw data if I leave out the f
> function.
[snip]

Are you trying to do this?

<html>
<h1>Test...</h1>
<?php
include("getWorldMap.php");
$wm = getWorldMap();
imagejpg($wm);
?>
</h1>

As Dave already explained, this won't work. Here's what you can do:
move the call to imagejpg() into getWorldMap.php, and then move the
image generation code out of the getWorldMap() function and into the
top level of getWorldMap.php. Then, in your main page, do something
like this:

<html>
<h1>Test...</h1>
<img src="getWorldMap.php">
</html>

-- David

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация