problem redirecting from header.php
-
Hello all,
Im trying to inclue an additional php code to the header page that will allow a page redirect on a button click,Into the header page in including the follwoing:
[CODE]
<?
if($_POST[‘submitmain1_x’]>0 || $_POST[‘submitmain1_y’]>0){header(“Location: https://www.google.co.uk”);
exit();
}
?>
[/CODE]AND
[CODE]
<form method=post action=<?php echo $_SERVER[‘PHP_SELF’]; ?> name=”myform” id=”myform”>
<input type=image src=”./../images/signin.jpg” alt=’start search’ name=”submitmain1″ id=”submitmain1″ style=”margin-left:160px; margin-top:5px”>
</form>
[/CODE]Therefore, when the button is clicked, I would like to be able to redirect to google.co.uk.
However, im getting the follwoing error:
“Warning: Cannot modify header information – headers already sent by (output started at D:\best-mobile-contracts.co.uk\wwwroot\blog\wp-content\themes\default\header.php:3)”Any id3eas where im going wrong/ Am I inseting the php rediret code into the wrong php file (header.php)?
Cheers for any help
- The topic ‘problem redirecting from header.php’ is closed to new replies.