graham23s Posted June 25, 2007 Share Posted June 25, 2007 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 More sharing options...
trq Posted June 25, 2007 Share Posted June 25, 2007 is that what you guys would do? No, but its just personal opininion. Personally, my functions never output anything, they simply return true or false only. Output is left up to any calling code. Link to comment https://forums.phpfreaks.com/topic/57170-question-on-include-and-function/#findComment-282478 Share on other sites More sharing options...
graham23s Posted June 26, 2007 Author Share Posted June 26, 2007 i see, maybe i should just leave it the way it is, it works no need to go changing it i guess lol thanks for the input mate Graham Link to comment https://forums.phpfreaks.com/topic/57170-question-on-include-and-function/#findComment-282481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.