This is the code:
<html>
<body>
<?php
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
if($iPhone || $iPad || $iPod) {
header( 'Location: http://example.com' );
}
else if($Android) {
header( 'Location: http://example.com' );
}
else {
echo "<p>Error</p>";
}
?>
</body>
</html>
I'm always getting this:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web7_57/html/test2.php:24) in /var/www/web7_57/html/test2.php on line 31
Does anybody know what I can do?