Page 1 of 1

Help -- PHP instead of frame in CSS

Posted: Thu Jun 02, 2005 2:53 pm
by HS0018
I see this feature all the time with CSS and PHP where I go to a link site and click on the links
the link is then displayed in a frame with the main websites frame in the middle excatly on the content <div>.

On my index.php. I already include the header, footer, sidebar just fine. It's just I don't have a clue how to direct the link to the content region.

Can anyone advise me how to do it without a frame. Instead with PHP please. Your help is greatly appreciated

Please help. :D Thank you..

Posted: Thu Jun 02, 2005 3:17 pm
by John Cartwright

Posted: Thu Jun 02, 2005 3:55 pm
by HS0018
I'm still confused. Can you show me a sample script that pointing to the selected region.

What I wanted to do is the same if you go to this page, http://www.feedforall.com/solutions.htm. click on the left hand side link and the content will appear on the right hand side / content region.

Thank you so much and apologize that you have to clarify it more in detail. I'm still a beginner with this.

Posted: Thu Jun 02, 2005 7:13 pm
by Illusionist
just include you header and side bar, make a div and position how you want, then include your footer

Posted: Fri Jun 03, 2005 12:18 am
by HS0018
I already include the header, sidebar, and the footer. They come up really nice. The problem is the content section and how do I use the link to point toward that region.

Thank you for taking your busy time.

Posted: Fri Jun 03, 2005 12:31 am
by Burrito
I'm confused...that link you posted is a site that when you click the left nav it loads a new page with different content in the middle??? there's nothing fancy going on there, just different content being loaded for every different page.

create a "template" file with the "body" where all of your meat goes. Change the meat on your different pages and and create your nav to load those pages...

in fact that site just has static html...not even using php

Posted: Fri Jun 03, 2005 3:33 am
by phpScott
the simplest way is to create each page like your index page with the header, footer and nav menu and then just change the content.
So when a user clicks on a link it will take them to that page with the same header, footer and nav menu.

Otherwise you have to start getting into layers or iframes which can cause some javascript headaches if your not that comfortable using js.

Posted: Fri Jun 03, 2005 10:30 am
by HS0018
Thank you Burrito and phpGuru. do you guys think I need a javascript code there? How do you create a template file where the body is where all the meat goes?

Thank you

Posted: Fri Jun 03, 2005 10:46 am
by Burrito
just set up your html and figure out where the content should go and save everything above it a header.inc.php file (or something like that).

for example on the link you sent, this would go in that file

Code: Select all

<html><!-- #BeginTemplate &quote;/Templates/common.dwt&quote; -->
<head>
<!-- #BeginEditable &quote;doctitle&quote; --> 
<title>FeedForAll - create, edit and publish rss feeds</title>
<meta name=&quote;description&quote; content=&quote;Software easily creates RSS feeds with software. Easily open, download or modify existing rss feeds and syndicate your content through rss feeds.&quote;>
<meta name=&quote;keywords&quote; content=&quote;create rss, make rss, rss, rss feeds, rss feed, xml rss feed, rss xml, feed, edit rss, download rss, newsfeed,news feed, rss news feed,  feeds, syndicate, syndication, rss specifications, rss specification, feed rss, rss feeds, rss feed, reader rss, aggregator, rss, rss news, rss xml, rss software, newsfeeds, rss&quote;>
<!-- #EndEditable --> 
<meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=iso-8859-1&quote;>
<meta name=&quote;MSSmartTagsPreventParsing&quote; content=&quote;TRUE&quote;>
<meta name=&quote;copyright&quote; content=&quote;2004 NotePage, Inc. All rights reserved.  Duplication of any content on this site is prohibited.&quote;>
<meta name=&quote;robots&quote; content=&quote;all&quote;>
<meta name=&quote;revisit-after&quote; content=&quote;14 days&quote;>
<meta name=&quote;distribution&quote; content=&quote;global&quote;>
<meta name=&quote;document-classification&quote; content=&quote;General&quote;>
<meta name=&quote;rating&quote; content=&quote;general&quote;>
<meta name=&quote;language&quote; content=&quote;EN&quote;>
<link href=&quote;ffa.css&quote; rel=stylesheet type=text/css>
<link rel=&quote;alternate&quote; type=&quote;application/rss+xml&quote; title=&quote;RSS&quote; href=&quote;http://www.feedforall.com/blog-feed.xml&quote; />
    <script language=javascript src=&quote;rollover.js&quote;></script>
</head>
<body bgcolor=&quote;#ffffff&quote; text=&quote;#000000&quote; onload=&quote;primg('image/ahome.gif','image/amap.gif','image/acontact.gif','image/asoft.gif','image/aorder.gif','image/adload.gif','image/asupport.gif','image/aresel.gif','image/apress.gif','image/aabout.gif','image/asolut.gif')&quote; link=&quote;#0099CC&quote; vlink=&quote;#006699&quote; alink=&quote;#006699&quote;>
<table height=100% width=100% cellpadding=0 cellspacing=0>
  <tr>
    <td valign=top height=&quote;564&quote;> 
      <table class=dhead width=100% cellpadding=0 cellspacing=0>
          <tr><td><div id=topa1></div><div id=topa2></div><div id=topa3></div></td></tr><tr><td><div id=topb1></div><div id=topb2></div><div id=topb3a1></div><div id=topb3a2></div><div id=topb3a3></div></td></tr>
       </table>


       
      <div class=name><img src=&quote;image/name.gif&quote; alt=&quote;rss feed creation tool&quote; title=&quote;FeedForAll :: RSS Feed Creation Tool&quote;></div>
       <div class=emblem><img src=&quote;image/emblem.jpg&quote; alt=&quote;logo&quote; title=&quote;logo&quote;></div>


       <div class=topmenu>
         <table border=0 cellpadding=0 cellspacing=0><tr>
            <td><a href=&quote;index.htm&quote; onMouseOver=&quote;overimg('t1','','image/ahome.gif',1)&quote; onmouseout=rest()><img src=&quote;image/home.gif&quote; alt=&quote;FeedForAll&quote; name=&quote;t1&quote;></a></td>
           <td><img src=&quote;image/tmvl1.gif&quote;></td>
            <td><a href=&quote;site-map.htm&quote; onMouseOver=&quote;overimg('t2','','image/amap.gif',1)&quote; onmouseout=rest()><img src=&quote;image/map.gif&quote; alt=&quote;RSS Feed Creation Site Map&quote; name=&quote;t2&quote;></a></td>
           <td><img src=&quote;image/tmvl2.gif&quote;></td>
            <td><a href=&quote;contact.htm&quote; onMouseOver=&quote;overimg('t3','','image/acontact.gif',1)&quote; onmouseout=rest()><img src=&quote;image/contact.gif&quote; alt=&quote;Contact FeedForAll&quote; name=&quote;t3&quote;></a></td>
         </tr></table>
       </div>


       <table class=dbody width=100% cellpadding=0 cellspacing=0 border=0>
     		<tr>
            		
          <td valign=&quote;top&quote; width=&quote;14%&quote; height=&quote;383&quote;> 
            <table width=&quote;145&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote; border=&quote;0&quote;>
              <tr align=&quote;left&quote; valign=&quote;top&quote;> 
                <td> 
                  <div class=menutop></div>
            					</td>
					</tr>
					<tr>
						<td>

							<div class=leftcell>
		
					                     <div class=menubody>
		                			        <div class=decor>
				        	                  
                        <div class=first><a href=&quote;feedforall.htm&quote; onMouseOver=&quote;overimg('m1','','image/asoft.gif',1)&quote; onMouseOut=rest()><img src=&quote;image/soft.gif&quote; alt=&quote;rss software&quote; name=&quote;m1&quote;></a></div>
		                			          
                        <div><a href=&quote;order.htm&quote; onMouseOver=&quote;overimg('m2','','image/aorder.gif',1)&quote; onmouseout=rest()><img src=&quote;image/order.gif&quote; alt=&quote;purchase rss software&quote; name=&quote;m2&quote;></a></div>
				                        	  
                        <div><a href=&quote;download.htm&quote; onMouseOver=&quote;overimg('m3','','image/adload.gif',1)&quote; onmouseout=rest()><img src=&quote;image/dload.gif&quote; alt=&quote;download rss software&quote; name=&quote;m3&quote; width=&quote;137&quote; height=&quote;21&quote;></a></div>
			                		          
                        <div><a href=&quote;support.htm&quote; onMouseOver=&quote;overimg('m4','','image/asupport.gif',1)&quote; onmouseout=rest()><img src=&quote;image/support.gif&quote; alt=&quote;RSS Feed Support&quote; name=&quote;m4&quote;></a></div>
					                          
                        <div><a href=&quote;resellers.htm&quote; onMouseOver=&quote;overimg('m5','','image/aresel.gif',1)&quote; onmouseout=rest()><img src=&quote;image/resel.gif&quote; alt=&quote;Resell Feed Software&quote; name=&quote;m5&quote;></a></div>
		                			          
                        <div><a href=&quote;press.htm&quote; onMouseOver=&quote;overimg('m6','','image/apress.gif',1)&quote; onmouseout=rest()><img src=&quote;image/press.gif&quote; alt=&quote;RSS News&quote; name=&quote;m6&quote;></a></div>
				        	                  
                        <div><a href=&quote;about-notepage.htm&quote; onMouseOver=&quote;overimg('m7','','image/aabout.gif',1)&quote; onMouseOut=rest()><img src=&quote;image/about.gif&quote; alt=&quote;About NotePage&quote; name=&quote;m7&quote;></a></div>
		                			          
                        <div><a href=&quote;solutions.htm&quote; onMouseOver=&quote;overimg('m8','','image/asolut.gif',1)&quote; onmouseout=rest()><img src=&quote;image/solut.gif&quote; alt=&quote;RSS Solutions&quote; name=&quote;m8&quote; width=&quote;137&quote; height=&quote;20&quote;></a></div>
					                        </div>
		        	        		     </div>
					                     <div class=menubot></div>
		                			</div>
						</td>
					</tr>
				</table>
			</td>
			
          <td valign=&quote;top&quote; width=&quote;86%&quote; height=&quote;383&quote;> 
            <table width=&quote;555&quote; height=&quote;262&quote; cellspacing=&quote;0&quote; cellpadding=&quote;0&quote; border=&quote;0&quote;>
              <tr align=&quote;left&quote; valign=&quote;top&quote;> 
                <td height=&quote;254&quote;> 
                  <table cellpadding=&quote;0&quote; cellspacing=&quote;0&quote; border=&quote;0&quote; width=&quote;100%&quote;>
                    <tr> 
                      <td height=&quote;18&quote; align=&quote;left&quote; valign=&quote;top&quote; width=&quote;76%&quote;> 
                        <div class=title><img src=&quote;image/welcome.gif&quote; alt=&quote;Welcome!&quote;></div>
                      </td>
                    </tr>
                    <tr> 
                      <td height=&quote;25&quote; align=&quote;left&quote; valign=&quote;top&quote; bgcolor=&quote;#FFFFFF&quote; width=&quote;76%&quote;> 
                        <br>
                        <table width=&quote;95%&quote; border=&quote;0&quote; cellspacing=&quote;0&quote; cellpadding=&quote;0&quote; align=&quote;center&quote;>
                          <tr> 
                            <td height=&quote;22&quote;>
the do the same thing for your footer, but for everythign after your content...again on the link you sent here's what it'd look like:

Code: Select all

</td>
                          </tr>
                        </table>
                        <p>&nbsp;</p>
                        <p>&nbsp;</p>
                        </td>
                    </tr>
                  </table>
						</td>
					</tr>
				</table>
			</td>
          	</tr>
       </table>
    </td>
  </tr>
  <tr>
    <td valign=bottom><div class=bottom>

       <table width=100% cellpadding=0 cellspacing=0 border=0><tr valign=bottom>
          <td><div class=footleft></div></td>
          <td><div class=footcntr>
             <div class=footblock>
                  <div class=altmenu><a href=&quote;http://www.feedforall.com&quote;>Home</a> 
                    | <a href=&quote;feedforall.htm&quote;>Software</a> | <a href=&quote;order.htm&quote;>Order</a> 
                    | <a href=&quote;download.htm&quote;>Download</a> | <a href=&quote;support.htm&quote;>Support</a> 
                    | <a href=&quote;resellers.htm&quote;>Reseller</a> | <a href=&quote;press.htm&quote;>Press</a> 
                    | <a href=&quote;about-notepage.htm&quote;>About us</a> | <a href=&quote;solutions.htm&quote;>Solutions</a> 
                  </div>
                  <div class=copyright>Copyright &copy; <a href=&quote;http://www.notepage.net&quote; target=&quote;_blank&quote;>NotePage, 
                    Inc.</a> All right reserved.</div>
             </div>
          </div></td>
          <td class=footright><div></div></td>
          <td class=footrright width=100% valign=top><div></div></td>
       </tr>   <script language=&quote;Javascript&quote;>
<!--- hide script from old browsers
  var accountID = &quote;10264&quote;;
  var referrer = document.referrer;
  var referrerUrlSplit = referrer.split(&quote;/&quote;);
  var referrerDomain = referrerUrlSplit&#1111;2];
  var localUrl = location.href;
  var localUrlSplit = localUrl.split(&quote;/&quote;);
  var localDomain = localUrlSplit&#1111;2];
  var localDomainSplit = localDomain.split(&quote;.&quote;);
  var topLevelDomain = localDomainSplit&#1111;localDomainSplit.length-2] +
&quote;.&quote; + localDomainSplit&#1111;localDomainSplit.length-1];
  if (referrer!=&quote;&quote; && referrerDomain.indexOf(topLevelDomain)<0)
  {
      var img = new Image();
      img.src = &quote;//www.filekicker.com/track.asp?ref=&quote; +
escape(referrer) + &quote;&accountID=&quote; + accountID;
      var img2 = new Image();
      img2.src = &quote;//mail.qwerks.com/images/cleardot.gif?ref2=&quote; +
escape(referrer);
  }
//-->
</script></table>

    </div></td>
  </tr>
</table> 

</body>
<!-- #EndTemplate --></html>
then you just put all of your meat in the middle. YOu also might want to create a nav.inc.php for your left nav menus so that if you ever need to change them, you only have to do it in one place.

Posted: Mon Jun 06, 2005 9:09 am
by HS0018
Thank you so much for the sample code, Burrito. I appreciate it. I found the solution by assigning a variable to grab the link and put it in the region.

<?php
$pool = @include($_GET['page'] . ".htm");
if (!$pool) { include("content.htm"); }
?>

Thank you again for all the help !