Jump to content

Help my CSS footer has gone awol


JackPike

Recommended Posts

Hi Jack,

 

Sorry to diversify and hope you sort your footer out soon.

 

As a fellow learner I will say that php include command is brilliant. Nick in the north showed me how to use it ages ago and its brill. Not at all complicated. I use it for menu's and other things that may appear on lots of pages. If your menu changes you then just have to change the 1 file rather than having to change the code on every page. Same applies to info in a footer.

 

<?php include("menu.php"); ?>

 

The code for the menu goes in 1 file saved in the same directory.

Link to comment
Share on other sites

  • 4 weeks later...
Just another problem is when viewed in 800x600 things go askew a little could I set my margins around the content to a percentage instead of a fixed value?

 

 

I think I have sorted it, what do you think, as far design I get the blank screen syndrome and stuck for ideas but I like the idea of using php to updated the navigation does that mean when I add another link in the menu I can just update the whole site using one command ?

 

BTW the updated page is here www.southportangling.co.uk/jan-website/news.html

Edited by JackPike

He who simply trys, Is not trying hard enuff

Link to comment
Share on other sites

What you do is separate the pages up into different files, that way you only need to edit one file for every page on your site.

 

eg: header.inc could be

 

<?phpecho '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Welcome to S.D.A.A</title><meta http-equiv="content-type"	content="text/html; charset=iso-8859-1" /><link rel="stylesheet" type="text/css" href="3col12.css" /></head><body> <div id="head"></div>';?>

 

main.inc

 

<?phpecho '<div id="content"><h1>Content for  id "content" Goes Here</h1>	<p>The S.D.A.A was founded in 1906 // ----SNIP ---- // Southport </p>	  </div> <div class="content1">	  <img src="pics/crabbebream.jpg" width="50%" height="35%" /></div>';?>

 

menu.inc

 

<?phpecho '<div id="nav2">	  <li>		<div align="center"><a href="#">About Us</a></div>	  </li>		// ---- SNIP ---- //		</li>		<li>		  <div align="center"><a href="#">Contact Us</a></div>		</li>		<div class="adbox">		  <div align="center"><img src="pics/copyofang11.jpg" width="150" height="150" />				  </div>		  <h2 align="center">just testing</h2> </div> </div>';?>

 

footer.inc

 

<?phpecho '<div id="side2"> <img src="ribbleleaflet.jpg" alt="" width="150" height="150" /> <div class="adbox"><img src="main-pics/atbutton.gif" width="150" height="150" /></div></div> <div id="footer">  <h2>FOOTER</h2></div></body></html>';?>

 

 

Then you would use the following to bring it all together

 

index.php

<?phpinclude('header.inc');include('main.inc');include('menu.inc');include('footer.inc');?>

 

If you wanted to keep the current file names, and your host supports it, then you could use "mod_rewrite" to "rewrite" the file extensions

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We and our partners use cookies on our website to give you the most relevant experience by remembering your preferences, repeat visits and to show you personalised advertisements. By clicking “I Agree”, you consent to the use of ALL the cookies. However, you may visit Cookie Settings to provide a controlled consent.