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
https://forums.phpfreaks.com/topic/57170-question-on-include-and-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.