Reputation: 1031
Please I have a small problem on my server :
When I use the php "header" function, it doesn't work :
header('location: /index.html');
I tried this line on another server with the same php version and it works finely !
PHP version : 5.1.65
Please any advice ?
Upvotes: 0
Views: 411
Reputation: 453
As Dylan Cross mentioned you mustn't have HTML output before the header.
If you have required a library before calling "header", it might contain the html -without paying attention- in the fallowing way :
<?php
// Code here
?>{If there is a space after this close tag, it's considered as an HTML output}
In this case you need to check all your libraries...
Upvotes: 1
Reputation: 1264
Try this you missed out the colon(:
):
header('location: /index.html');
Upvotes: 0