I'm running a static website with some php put into it. I'm a very basic beginner in PHP and I'm wondering how I could do the following: On a page of my website I wan't to have 3 links. Each link I want to display different content when clicked, but stay on the same page. For example, You click a link and go to someones portfolio on their website. They're 3 more links on the portfolio page: "Websites" "Graphics" "Audio" When you click "Websites", I would want the content on the page to change to "websites" content, if you click "graphics" I want the content to change to "graphics" content - all while staying on the "portfolio" page. So I know I would need 3 seperate php files for each link within the portfolio page to hold the content. Then use an includes on the page? I'm stuck! I imagine it's super easy I'm just having some massive brain tard problems now.
You must use javascript, so you can loading content with playing css or using ajax for loading your content here's the references: http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/ http://www.electrictoolbox.com/load-content-jquery-ajax-loading-image/
You must use an AJAX request for that, using jQuery, it would look something like this: $("#websites").click(function(){ $.get("websites.php", function(data){ $("#divYouWantTheContentInside").html(data); }); }); And that's it.