GeekyG Posted January 21, 2008 Share Posted January 21, 2008 Hello, In the “featured work” section of my new portfolio, I am using image screen shots of the project, anywhere from 1 to 10 images depending on the size of the project. Although I got everything to work correctly, I realize now that these images, are really slowing down the download time of the page. Not good. Essential all of the images are “hidden” until the end-user clicks on a button. Here is the url: http://www.multimedia-designs.com/V3/HTML/projects/featured_project.php Using PHP, what is the best way to have the same page but a different image when the end-user clicks on a button? I like the way this website displays the images: http://www.benhulse.com/web/dunnett-1.php . Is this just using the include function? If so, is this the best way? All help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/ Share on other sites More sharing options...
adam291086 Posted January 21, 2008 Share Posted January 21, 2008 If you want it this way http://www.benhulse.com/web/dunnett-1.php you will need to do. 1) Create a php script that takes the pictures id from the url, using the $_GET function. 2) using the Id from the url change your img source to look something like <img scr = filepath/$id. Then change the pictures name to = this id 3) Create something similar to a pagination script to help create a number of image links depending on the number of images you have. Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/#findComment-445133 Share on other sites More sharing options...
GeekyG Posted January 21, 2008 Author Share Posted January 21, 2008 This is a little over my head, but I will definitely look into how to do this. Would you say this is the best way to accomplish what I am trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/#findComment-445145 Share on other sites More sharing options...
adam291086 Posted January 21, 2008 Share Posted January 21, 2008 That is the best way in my opinon because you are only reloading the picture rather than the whole page. Also Sacrifice some image quality so load times are quicker. Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/#findComment-445148 Share on other sites More sharing options...
GeekyG Posted January 21, 2008 Author Share Posted January 21, 2008 Thank you very much for your pro opinion! And wish me luck.... Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/#findComment-445176 Share on other sites More sharing options...
adam291086 Posted January 21, 2008 Share Posted January 21, 2008 i am no Pro. I still have loads to learn. If you get any problems post them here or try google. Quote Link to comment https://forums.phpfreaks.com/topic/87048-solved-same-page-different-images/#findComment-445188 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.