By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,050 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,050 IT Pros & Developers. It's quick & easy.

PHP-created images

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Eric Stein" <no@spam.com> wrote in message
news:c6***********@news.wplus.net...
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


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


Jul 17 '05 #2

P: n/a
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:c6***********@news.f.de.plusline.net...
if you really must get technical, requiring the images is not
loading/creating them dynamically even if the php is somewhat
dynamic. -Robin

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.