xenowing Posted January 11, 2011 Share Posted January 11, 2011 I have a page with links to images. Currently the images open in a blank browser window, and I think this is too plain. I don't want to create an HTML file for each image. I want to have an 'image display php file' - img_temp.php. Along with the reference to the image file, in the link, I want to also be able to send a <title> to the template file. I think the code below shows kinda' what I'm trying to do, and also shows that I don't quite have a grasp on how to do it. Any tips would be appreciated. Index Page (index.php) <html> <head> <title>Gallery Links</title> </head> <body> <!-- This is the page with the links to the images --> <ul> <li><a href="img_temp.php?file=images/01.jpg<?php ?title = "This is image 1"?>">Image 01</a></li> </ul> </body> </html> Image Display Template (img_temp.php) <html> <head> <title><?php echo $title ?></title> </head> <body> <!-- This is the page that displays the sent image and displays the appropriate doc title --> <?php //Output the image $file echo $file; ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/224067-open-linkimage-in-template-file/ Share on other sites More sharing options...
trq Posted January 11, 2011 Share Posted January 11, 2011 What part exactly are you having trouble with? Opening the new window? Link to comment https://forums.phpfreaks.com/topic/224067-open-linkimage-in-template-file/#findComment-1157824 Share on other sites More sharing options...
xenowing Posted January 11, 2011 Author Share Posted January 11, 2011 I'm getting a syntax error in the link, and I just don't know what to do with it. Link to comment https://forums.phpfreaks.com/topic/224067-open-linkimage-in-template-file/#findComment-1157826 Share on other sites More sharing options...
BlueSkyIS Posted January 11, 2011 Share Posted January 11, 2011 <li><a href="img_temp.php?file=images/01.jpg" title="<?php echo "This is image 1"; ?>">Image 01</a></li> Link to comment https://forums.phpfreaks.com/topic/224067-open-linkimage-in-template-file/#findComment-1157893 Share on other sites More sharing options...
xenowing Posted January 11, 2011 Author Share Posted January 11, 2011 Tx! Very helpful Link to comment https://forums.phpfreaks.com/topic/224067-open-linkimage-in-template-file/#findComment-1157896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.