Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP-created images

Eric Stein
Guest
 
Posts: n/a
#1: Jul 17 '05
Hello all,
I've been wondering - how do I make dynamic images in PHP (example - the
PHP and Zend logos when you do phpinfo().)? I have seen it done on several
websites and I want to do it.
Also, is there a correct way to use PHP to retrieve images? The only
way I've ever got this to work is using require(). Here is what I did
(note: it only works with ASCII encoded images, otherwise PHP errors):

<?php

switch ($imgnum)
{
case "1":
require ("/home/img/menubutton.gif");
break;
case "2":
require ("/home/img/userprfl_bt.gif");
break;
case "3":
require ("/home/img/srch.gif");
break;

//etc...

case "":
default:
require ("/home/img/error.gif");
break;
}

?>

If you know how to do this, please post.
~Eric

My PGP public key: http://www.parabolagames.com/chem/pgppubkey.txt



Robin
Guest
 
Posts: n/a
#2: Jul 17 '05

re: PHP-created images



"Eric Stein" <no@spam.com> wrote in message
news:c6jtl9$1n1c$1@news.wplus.net...[color=blue]
> Hello all,
> I've been wondering - how do I make dynamic images in PHP (example -[/color]
the[color=blue]
> PHP and Zend logos when you do phpinfo().)? I have seen it done on[/color]
several[color=blue]
> websites and I want to do it.
> Also, is there a correct way to use PHP to retrieve images? The only
> way I've ever got this to work is using require(). Here is what I did
> (note: it only works with ASCII encoded images, otherwise PHP errors):
>
> <?php
>
> switch ($imgnum)
> {
> case "1":
> require ("/home/img/menubutton.gif");
> break;
> case "2":
> require ("/home/img/userprfl_bt.gif");
> break;
> case "3":
> require ("/home/img/srch.gif");
> break;
>
> //etc...
>
> case "":
> default:
> require ("/home/img/error.gif");
> break;
> }
>
> ?>
>
> If you know how to do this, please post.
> ~Eric[/color]

if you really must get technical, requiring the images is not
loading/creating them dynamically even if the php is somewhat
dynamic. -Robin




Eric Stein
Guest
 
Posts: n/a
#3: Jul 17 '05

re: PHP-created images


Robin,
I am perfectly aware of that. But I also know that you can create them
dynamically - I did find the info I was looking for at
http://us4.php.net/manual/en/ref.image.php. Mastering that looks like it's
going to be difficult.
~Eric

My PGP public key: http://www.parabolagames.com/chem/pgppubkey.txt

"Robin" <robin @ infusedlight.net> wrote in message
news:c6mabi$22ou$4@news.f.de.plusline.net...[color=blue]
> if you really must get technical, requiring the images is not
> loading/creating them dynamically even if the php is somewhat
> dynamic. -Robin[/color]


Closed Thread