I have a button:
<form method="post">
<input name="submit" type="submit" class="icon2" value=" " />
</form>
And a redirect with a header using following code:
<?php
$homepage = '/2013/php/nelson-test.php';
$currentpage = $_SERVER['REQUEST_URI'];
if(isset($_POST['submit']) && $homepage==$currentpage)
{
header('Location:/2013/php/nelson.php');
}
?>
I used the exactly same code yesterday in a different site and it works (I only changed the links), and now it gives me this error:
Warning: Cannot modify header information - headers already sent by (output started at /homez.121/pneuexpo/www/2013/php/nelson-test.**php:1**) in /homez.121/pneuexpo/www/2013/php/nelson-test.php on **line 6**
I don't understand why since in line one I only have the php beginning tag and on line 6 there is only the header. Any ideas?
(BTW the purpose of the button and the header is that when you click the button it redirect to the same page but in English (the page is currently in French))