Ok, I have page one(index), fully functional and working fine as is with all content loading into an iframe. However, due to the layout’s design, I wanted my portfolio to have more space for viewing, so I created another page for the portfolio (p.html). Now, since there is no way (that I know of or could figure out) to click a link on p.html and tell it to open for example home.html#top within the iframe named “content.” So, I toyed with some php and came up with the following code:
<?php
switch($_GET['go']) {
case 'home': $src='pages/home.html#top'; break;
case 'about': $src='pages/about.html#top'; break;
case 'contact': $src='pages/contact.html#top'; break;
default: $src='pages/home.html'; break;
} ?>
Then, on index.php, in the iframe I have <?=$src;?> set as the source.
Now, when you first load http://www.djcproductions.net, everything works fine, the default page home.html loads in the iframe as it should. However, click on any of the links in the nav bar and it will somehow class with my CSS for the content. If you pay attention when you first go to the site, and scroll down to the text, you can see the background image as the contentstyle.css file is set up for home.html to have a transparent background. But, once you click any link, that goes out the window and the background is not transparent EDIT and it also seems to shift the page loaded into the content iframe to the right about fifty pixels. So, since the default line of code for the home.html in the php code worked as it should, I thought maybe it was the #top messing stuff up. So, I removed all the #top tags from the links, and tried it again. Again, on load the page is fine, then I click a link and my whole index.php page loads into the iframe?! My mind is blown. Am I doing this all wrong, or is it just one stupid line I am missing or something?
On the issue of the About Us page not loading. Here is my summary of the issue.
If I manually put
http://www.djcproductions.net/index.php?go=aboutin the browser address bar, it all works. This means your PHP switch statement is happy as long as you supply the request paramter.When I look at your link, it has a target attribute:
This means it is loading the whole page into the iframe, which I’m pretty sure is not what you are trying to do.
If you change your hyperlink to:
It will work. Equally, if you change it to:
It will work.
Just don’t use the target and the full page link together.