stevejvan Posted July 8, 2009 Share Posted July 8, 2009 I have only used php includes to prevent the duplication of headers, nav, etc on a page in the past. I have a BS in Computer Science so I am familiar with programming, but..... I am trying to create a html / css photo portfolio website. I want the portfolio page to have genre links (families, nature, weddings, etc) and hopfully with your help clicking those links would pull up that specified group of thumbs and drop them into the designated body area. The page would include thumbs with a lightbox plugin. I am not sure if the thumbs would have to be in an html file, or if this is a programming thing. I am sure there are probably plugins to do this, I would rather code if it isn't TOO involved. If someone knows of a good free plugin, that would be great too. Any help would be greatly appreciated. Steve Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/ Share on other sites More sharing options...
trq Posted July 8, 2009 Share Posted July 8, 2009 Where exactly are you stuck? By the way, theres no such thing as a plugin in php. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-870976 Share on other sites More sharing options...
shergold Posted July 8, 2009 Share Posted July 8, 2009 use $_GET, for example: set your hyperlinks like so <a href="www.mywebpage.com/gallery?=wedding> then on the gallery page make code like so: <?php $page = $_GET['page']; if ($page == 'wedding') include ('wedding.php') elseif ($page == 'family') include ('family.php') else include ('gallery.php') ?> i hope that helps, shergold. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-870980 Share on other sites More sharing options...
stevejvan Posted July 8, 2009 Author Share Posted July 8, 2009 Easy enough! Thank you so much for taking the time to answer. I appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-871010 Share on other sites More sharing options...
shergold Posted July 8, 2009 Share Posted July 8, 2009 no problem. shergold. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-871025 Share on other sites More sharing options...
stevejvan Posted July 9, 2009 Author Share Posted July 9, 2009 I am having some problems with this. When I click on the link for the genre it isn't including the genre page. If I go to view the source, it isn't listed their either. What am I missing?! I don't know if I need all the brackets in the php, I was getting "Unexpected elseif" without them. Also, in the HTML files I am including, I don't have the body or html, tags, I hope that is right. Let me post my code. Here is the code for the links.... <ul id="genres"> <div id="genreswrap"> <li><a href="?page=families"><img src="images/genre_families.png" /></a></li> <li><a href="?page=nature"><img src="images/genre_nature.png" /></a></li> <li><a href="?page=seniors"><img src="images/genre_seniors.png" /></a></li> <li><a href="?page=engagements"><img src="images/genre_engagements.png" /></a></li> <li><a href="?page=weddings"><img src="images/genre_weddings.png" /></a></li> </div> <!-- genreswrap" --> </ul> <!-- genres --> Here is the content of one of the genre HTML files just as a test.... No HTML tag, or body, etc..... <img src="images/nature/Nature-1.jpg" /> And lastly, here is the PHP code: <?php $page = $GET['page']; if($page == "families") { include ("families.html");} elseif($page == "nature"){ include ("nature.html");} elseif($page == "seniors"){ include ("seniors.html");} elseif($page == "engagements"){ include ("engagements.html");} elseif($page == "weddings"){ include ("weddings.html");} ?> Again, I appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-872020 Share on other sites More sharing options...
ignace Posted July 9, 2009 Share Posted July 9, 2009 This should be a .php page if it contains php code or it won't get executed: include ("families.html"); Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-872031 Share on other sites More sharing options...
stevejvan Posted July 9, 2009 Author Share Posted July 9, 2009 families.html only has the <a href="> tags. The portfolio.php file has the php in it. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-872143 Share on other sites More sharing options...
trq Posted July 10, 2009 Share Posted July 10, 2009 The array your after is $_GET not $GET. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-872665 Share on other sites More sharing options...
stevejvan Posted July 10, 2009 Author Share Posted July 10, 2009 $_Get worked! I am so happy! Thank you everyone for your time and help. Quote Link to comment https://forums.phpfreaks.com/topic/165181-newbie-photo-genre-link/#findComment-872764 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.