Jump to content

Recommended Posts

Ok this is a bad problem as I just converting my site to CSS.

 

Now for validation i always header away users.. but now cos i have this:

 

<?php
include css1 file
//php stuff
header("page etc etc ");
include css2 file
?>

 

I am obviously now getting:

 

Warning: Cannot modify header information -

headers already sent by (output started at C:\xampp\htdocs\css\layout1.php:142)

in C:\xampp\htdocs\myitems.php on line 179

 

There must be a work around to this!? Obviously CSS is going to happen first before the php.  Between the two files the php is in a column of the CSS so i have to split it like that... so does this mean i can now only print errors and never header people away?

 

 

Link to comment
https://forums.phpfreaks.com/topic/84800-big-problem-with-headers/
Share on other sites

Wait i am using an if condition ..its basically if the $_GET is wrong it has this at the very end:

 

}Else{

Header the page

}

 

No content is shown from the php outside an IF statement. But the CSS is.

 

So what does ob_start() and ob_flush() do? And why is it bad practice?

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.