You are here: creating and presenting an image in php « PHP Programming Language « IT news, forums, messages
creating and presenting an image in php

Posted by Nick Wedd on 01/30/07 10:59

Maybe this isn't really a PHP problem. But it's possible that PHP has a
good solution for it.

I have a php page which collects some input from the user, constructs an
image, and then displays it to the user. The line of php that does the
actual presentation to the user is
print "<a href='$string'><img src='$string' width=784 height=431
border=0></a>\n";
where $string is something like
'r.pl?ar=7;cl=10'
so the user gets to see a (large) thumbnail, and can then click on it to
see the full-sized version.

(The actual nitty-gritty of the image creation is done in Perl not PHP.
I wrote it before I became more familiar with PHP and learned that PHP
uses the GD library. I could rewrite it into PHP if I have to.)

My problem is that my code calls r.pl twice, to do the same thing: once
when the page is created, and once when the user clicks on the image.
This wastes quite a bit of cpu time on the server, and slows the
response for the user. What I would prefer to do is call r.pl once, put
the resulting image in some kind of temporary session-specific file on
the server (or in its memory), and then use this temporary thing twice,
in place of $string above. Is this somehow possible?

Nick
--
Nick Wedd nick@maproom.co.uk

 

Navigation:

[Reply to this 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

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