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>

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[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

Link to comment
Share on other sites

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.