View Single Post
Old 15 May 2010, 11:16   #81
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
If you don't know PHP that kinda explains why you're using frames. I did the same before I learnt PHP because modifying one menu file inside a frame is a lot easier than editing the menu in loads of pages.

If you've got PHP enabled on the web space you can use one of the most basic features - including files.

With plain HTML you can create a site on your computer and play with it until it looks right then upload it but that's not the case with PHP - you need to either install Apache and PHP on your machine (effectively turning it into a server - best to install WAMP or XAMP - Google them!) or upload scripts to your web space for testing (which is what I do)

Imagine this file...
Code:
<html>
<body>
  <div id="menu">loads of HTML here for our menu</div>
  <div id="content">loads of HTML here for our main part</div>
  <div id="footer">some HTML here for our footer</div>
</body>
</html>
Let's call that something like "example.php" - it could end in .html but we're going to split the menu into a new file - "inc-menu.php" so our script is now:

Code:
<html>
<body>
<?php include('inc-menu.php'); ?>
  <div id="content">loads of HTML here for our main part</div>
  <div id="footer">some HTML here for our footer</div>
</body>
</html>
...and in "inc-menu.php" all we have is this:
Code:
  <div id="menu">loads of HTML here for our menu</div>
PHP blocks start with <?php and end in ?>
Upload those two files to your web space and see how the menu file is included in.
Yesideez is offline  
 
Page generated in 0.15465 seconds with 11 queries