Jump to content

Question on include and function


graham23s

Recommended Posts

Hi Guys,

 

just a quick question, when doing sites i normally have:

 

header.php

footer.php

navbar.php

 

for the different sections, and just make them includes, but would i just be better putting them in functions? that way i suppose they are all in the 1 page as oppose to 3?

 

example header.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">                     
<link rel=stylesheet href="css/ba.css" type="text/css">
<title></title>
      <link rel=stylesheet href="css/ba.css" TYPE="text/css">
</head>
<body>
<table width="100%" border="0" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center" />
  <tr>
   <td colspan="2" bgcolor="#004E98" height="80" align="center" /><img src="images/header.gif" /></td>
  </tr>

 

to: (not exact)

 

function site_header() {

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">                     
<link rel=stylesheet href="css/ba.css" type="text/css">
<title></title>
      <link rel=stylesheet href="css/ba.css" TYPE="text/css">
</head>
<body>
<table width="100%" border="0" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center" />
  <tr>
   <td colspan="2" bgcolor="#004E98" height="80" align="center" /><img src="images/header.gif" /></td>
  </tr>

   return;
    
}

 

is that what you guys would do?

 

any input is appreciated

 

Graham

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.