Forum Moderators: coopster
code on main page:
<a href="javascript:;" onClick="MM_openBrWindow('../../window.php?image=mg/latehistorical/mga_concept.jpg','','resizable=yes,width=560,height=435')">
code on popup page:
<img src="<?php echo ''.$_GET["image"].'';?>" border="0">
How do I include text on the popup page as well as the photo? Thanks.
You could set a switch statement and get text depending on which case is true. So lets say you have your text in strings, like this:
$image1 = "This is image one";
$image2 = "This is image two";
On your image page do something like:
switch($_GET['image'])
{
case "mg/latehistorical/mga_concept.jpg":
echo $image1;
break;
case "mg/latehistorical/something.jpg":
echo $image2;
break;
}
and so on
Might be best to put your text into an array and call it by numerical indices.
Hope that helps. :)
Bascially what I'm doing is calling a single page called "window.php" to display a photo enlargement. This file is called up from numerous other pages throughout the site. I was hoping to be able to include a block of text with the code of each thumbnail to keep it simple.
Here's an example of the pages I'm working on. The thumbnails have short captions but I'd like to include full descriptions on the popup page (window.php).
The complete code for the "window.php" page is as follows:
<html>
<head>
<title>Image Window</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="000000">
<div align="center">
<p><a href="javascript:window.close()"><img src="" border="0"></a></p>
<p><font color="#FFFFFF">Click image to close</font></p>
</div>
</body>
</html>
[edited by: jatar_k at 4:55 pm (utc) on Nov. 8, 2004]
[edit reason] removed url [/edit]
At this point it could be worthwhile learning php and mysql (or some other db) by means of online tutorials or books or something. To get this to do what you want will probably take more than just us supplying code snippets to you.
Larry Ullman has a PHP & MySQL book which may be just what you need.
Hope this helps
Cheers
Richard