MyBB Community Forums

Full Version: index.php and index.html
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I just made a splash page for my mybb forum 

8bits-gaming.com/downloads/splash/index.html

and since its not optimized for mobile version and there is no need for it in phone anyways and Im gonna soon move it to the main domain. 

But before that I searched up to see a redirect code for mobile version and came up with this one but it requires a php index, which is currently used by me.

<br />
&lt;!--?php &lt;br ?--&gt;   $iphone = strpos($_SERVER['HTTP_USER_AGENT'],&quot;iPhone&quot;);<br />
   $android = strpos($_SERVER['HTTP_USER_AGENT'],&quot;Android&quot;);<br />
   $berry = strpos($_SERVER['HTTP_USER_AGENT'],&quot;BlackBerry&quot;);<br />
   $ipod = strpos($_SERVER['HTTP_USER_AGENT'],&quot;iPod&quot;);<br />
   if ($iphone || $android || $palmpre || $ipod || $berry == true)<br />
   {<br />
      echo &quot;&lt;script&gt;// &lt;![CDATA[<br />
window.location='http://m.site.com'<br />
// ]]&gt;&lt;/script&gt;&quot;;<br />
 }<br />
?&gt;<br />


I just wanna ask if I can use index.php to execute this code and then redirect it to index.html?

is it possible this way? 
Thanks
You shouldn't have HTML Ampersand codes in your PHP.