På Wed, 18 Feb 2004 18:09:39 -0800, skrev Jedispy
<je***************@yahoo.remove.me.com>:
(...)
a simple script (...)
that displays the image, and a caption.
(...)
Can this be done? If so, how do I do it in PHP?
------ File show.php ---------------
<html><body>
<?php
#Arrays to store image urls and captions:
$images = array();
$captions = array();
#Put images and captions into the arrays.
#NB: This must be done pair-wize, or images
#and captions will become out of synch.
#Add image one:
array_push($images,"http://www.url.com/images/img1.jpg");
array_push($captions,"This is image one";
#Add image two:
array_push($images,"http://www.url.com/images/img2.jpg");
array_push($captions,"This is image two";
#And so on...
#Check if we can display an image and it's caption:
if(isset($img) && is_numeric($img) && isset($images[$img]) &&
isset($captions[$img])) {
#We can, so that's what we'll do:
echo "<img src='$images[$img]'><br>$captions[$img]<br>"
}
?>
</body></html>
------------------------------------
If you now call show.php like this:
http://www.domain.com/show.php?img=1
show.php will display image number one, with it's caption.
Now, you asked for "simple", and you got it. Simplar than
this it probably can't be done :-)
You would probably want to change how the image and the
caption is displayed though.
--
Fred H
void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}