Forum Moderators: coopster
The problem is you are using the header function after you have already sent data to the browser. For more information see the following:
[uk.php.net...]
You could try using an include, which would load a page or maybe a meta refresh.
Alternatively, try altering your code so that no data gets sent before you call the header function.
dc
I have already viewed this page before posting, and tried many of the ways it says on it with no success. I have even tried just having
<body><?php header("Location: index.html");?></body>
but this does not work either.
Do you think it is because i am using it on my local machine?
I have thought about using meta tags to refresh the page after a second or so but i feel that this is rather unelegant.
I have seen on a few php pages (especially file upload and php email) that instead of directing to a page to do the processing then directing to another page that the processing is just done at the top of the page that you would be directing to before any html is displayed, thus cutting out a page.
Is this generally how it is done?
Ally
<body onload="doRedirect();">
<script language="JavaScript">
<!--
var sTargetURL = "<?=$your_link?>";
function doRedirect() {
// this will load the page in 5 secs...
setTimeout( "timedRedirect()", 5*1000 );
}
function timedRedirect(){
window.location.href = sTargetURL;
}
-->
</script>