php code displaying on site - whats wrong?
Posted: Wed Aug 26, 2015 5:29 pm
I added the following php code to my template in order to redirect mobile users to my mobile site.
It works great but I can see some of the code on the main webite.
"window.location=’https://californiaschooloflaw.com/admin/mobile/'”; } ?>"
What did I miss and how can I correct this?
It works great but I can see some of the code on the main webite.
"window.location=’https://californiaschooloflaw.com/admin/mobile/'”; } ?>"
What did I miss and how can I correct this?
Code: Select all
<head>
<?php
$iphone = strpos($_SERVER[‘HTTP_USER_AGENT’],”iPhone”);
$android = strpos($_SERVER[‘HTTP_USER_AGENT’],”Android”);
$palmpre = strpos($_SERVER[‘HTTP_USER_AGENT’],”webOS”);
$berry = strpos($_SERVER[‘HTTP_USER_AGENT’],”BlackBerry”);
$ipod = strpos($_SERVER[‘HTTP_USER_AGENT’],”iPod”);
if ($iphone || $android || $palmpre || $ipod || $berry == true)
{
echo “<__script__>window.location=’https://californiaschooloflaw.com/admin/mobile/'</__script>”;
}
?>