Jump to content

[SOLVED] header error


pcw

Recommended Posts

Hi, I am trying to use this page as a header function for my script, but when I try to call the function in another file, I get this error:

 

 

Fatal error: Cannot redeclare header() in /home/public_html/templates/admin/header.php on line 42

 

This is the code for header.php

 

<?php 
function header() {
print <<<HEADER
<html>
<head>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
}
.style2 {
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}
.style3 {
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;

.style4 {color: #FFFFFF}
.style6 {color: #FFFFFF; font-weight: bold; }
.style7 {color: #FFFFCC}
}

-->
</style>

</head>
<body bgcolor="#14285f">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr bgcolor="02021e">
    <td height="58" nowrap="nowrap" colspan="3" id="logo" valign="bottom"><div align="center" class="style1">MySite </div></td>
  </tr>
  <tr bgcolor="02021E">
    <td height="57" nowrap="nowrap" colspan="3" id="tagline" valign="top"><div align="center" class="style2">Test Page</div></td>
  </tr>
</table>
<br>
HEADER;
}
?>

How do I fix this? I just want to use headers and footers as a function, as it is quicker and tidier than typing it all out.

Link to comment
https://forums.phpfreaks.com/topic/148928-solved-header-error/
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.