Jump to content

getting an header error when using an image preloader than redirecting


Recommended Posts

I done it before with no problems but now, I'm having issues with this

 

here is my script

 

 

 

<div class="load">

<?

 

$d = $_ENV['DOCUMENT_ROOT'];

 

$d = $d."/images/";

 

$dir = opendir($d);

 

while ($f = readdir($dir))

{

 

$size = getimagesize("images/$f");

 

echo "<img src=\"images/$f\" $size[3] >";

}

 

 

 

header("location: http://plagueinfected.com/tranquildesigns");

 

?>

</div>

 

header reading that will help as well. You cannot make a header call after output (the <div) has been sent to the browser. Simple as that. All header/session_start etc calls must be before output. The ob_start is just a bandaid for the real issue. You should not make any output till after the script runs as a rule of thumb.
[quote author=PlagueInfected link=topic=251312.msg1179170#msg1179170 date=1241706383]
thanks guys, i rushed into it before reading. haven't been here in a while and im still new to programming.

so if i was to use the ob_start() where would i put it or even insert in it, i never used it
[/quote]

It would have to be before the output as well. So the first item on your page.

[code=php:0]<?php
ob_start();
?>

<div id="unload">
<?php

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.