Jump to content

Headers And Output


EchoFool

Recommended Posts

I was wondering if a way to avoid output clashing with headers... would be in the main "include" file which is on all my sites... to have:

 

layout1.php (global include file)

<?php
require_once("functions.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>
<title></title>
<link rel="stylesheet" type="text/css" href="/css/main2.css" />
<link rel="stylesheet" href="/css/thickbox.css" type="text/css" media="screen" />
</head>
<body>
<div id="top">
  <div align="center"><img src="header.gif" alt="" width="327" height="98" /></div>
</div>

 

 

Now say i have a page like this:

 

register.php:

<?php
include($_SERVER['DOCUMENT_ROOT'].'/css/layout1.php'); //this is the script above
redirect_to("login.php?failed");
die;
?>

 

 

Wouldn't that technically avoid the headers already started issue because the function is in an include which is "before" anything?

Link to comment
https://forums.phpfreaks.com/topic/108543-headers-and-output/
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.