XeZon87 Posted October 25, 2008 Share Posted October 25, 2008 Hi, I'm a novice in php, I've worked around php for a while but I cannot call myself a pro scripter yet. heheh anyways I was wondering if this is possible: link.com/img.php?=image1.jpg = calls up image 1 link.com/img.php?=image2.jpg = calls up image 2 it's a basic script that calls up the image (depends on the URL) and yet it will display it in a page with the same template (sort of like header.php and footer.php) I'm pretty sure it possible, if yes, can you link me to a tutorial of it? Thanks for reading and helping me out, Andrew Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/ Share on other sites More sharing options...
JavaNinja Posted October 25, 2008 Share Posted October 25, 2008 Not sure what you are after. Can you tell me exactly what you want to do? My guess is you want to bring up different images using php to provide its location? Something like this then: <?php <img src="<?php echo $imageLocation; ?>" alt="image" /> //$imageLocation can be http://www.yoursite.com/image.jpg ?> Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674363 Share on other sites More sharing options...
dropfaith Posted October 25, 2008 Share Posted October 25, 2008 actually its pretty easy to explain and do look up the $get function $image = ($_GET['image']); also when linking the files its link.com/img.php?image=image1.jpg Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674364 Share on other sites More sharing options...
dropfaith Posted October 25, 2008 Share Posted October 25, 2008 i also assume use of mysql then when making the links just loop thru the data base and echo out the image name into the link Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674366 Share on other sites More sharing options...
XeZon87 Posted October 25, 2008 Author Share Posted October 25, 2008 no I do not wish to use mysql to echo out the name. Can anyone link me to a php tutorial of it? Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674367 Share on other sites More sharing options...
JavaNinja Posted October 25, 2008 Share Posted October 25, 2008 I still haven't got a clue of exactly what you are trying to do. Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674386 Share on other sites More sharing options...
dropfaith Posted October 25, 2008 Share Posted October 25, 2008 how are you getting the images on the page mysql would be the easiest way imo Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674388 Share on other sites More sharing options...
XeZon87 Posted October 25, 2008 Author Share Posted October 25, 2008 hmm ok let me try to explain it again. in a directory there's: img.php image1.jpg image2.jpg I want to link Andy to image1.jpg so the link would be img.php?=image1.jpg Cindy get to see the image2.jpg so the link would be img.php?=image1.jpg img.php?=X X is the image name so whenever I go to img.php?=X link it would display the image according to X and what do you mean by mysql exactly. this is suppose to be a simple php script without the use of mysql. but explain to me what you meant Link to comment https://forums.phpfreaks.com/topic/130062-link-image-php-possible/#findComment-674417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.