I am building a static website, and I have images in my index page each image has a title name, how do I make an image clicked to open in a different window if clicked, I have a template page designed to be used for opening an image in a different window if clicked but I don`t know how to configure everything. Secondly, I would want the image to be placed in a particular section in the template page.

Recommended Answers

All 2 Replies

This could be achieved with php on the template page, and using a URL like my_script.php?file=img.png&t=my%20image.

I will provide an example.

<HTML>
<head>
<title>Gallery : <?php echo $_GET['t']; ?></title>
</head>
<body><div align="center">
<table>
<tr><td><b><?php echo $_GET['t']; ?></b></td></tr>
<tr><td><img src="images/<?php echo $_GET['file']; ?>" /></td</tr>
</table></div>
</body>
</HTML>

sorry about any wiered caps, used iOS to publish this.
This code obviously requires some added security, and you can open the window with JavaScript.

Thank you very much Mathew this served me very well, I wasn`t arround to reply this post on time I am sorry for thst

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.