473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

PHP-created images

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
2 1633

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
59
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
1
by: ansc1 | last post by:
Hello, I'm new to using php coding. I need help with the following: 1. There is a submit button on the form and is saves information to my database. After clicking on "Save Measurement" it...
0
by: tsivaraman | last post by:
I am trying to build php-5.2.1 in RedHat Linux 9. I have installed libxml2-2.6.11,mysql-5.0.33,httpd-2.2.4(apache) successfully.When i do 'make' from the php directory,i get the following...
0
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
0
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ...
4
by: mechphisto | last post by:
I'm working on a friend's box, Fedora Core 6. It has PHP 5.1.6. I need to install mcrypt into it, and the only way I can find to do it is from source then recompile PHP. So I did all that, and got...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
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...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.