I am dynamically adding a hash to a url – taking that strpos and trying to display a certain footer based on that variable, I know I could just translate the whole page but I need to do this for a client, why isn’t it working I suppose is the question?
The url looks like http://www.example.com/#/sp/
Here is my header:
<?php
$page = $_SERVER['REQUEST_URI'];
$isSpanish = strpos($page, '/sp/');
$isSpanishDynamic = strpos('#/sp/', $page);
Here is my footer:
<?php if($isSpanishDynamic !== FALSE || $isSpanish !== FALSE) { ?>
<li><a href="/">PÁGINA DE INICIO</a></li>
<li><a href="/sp/our-story">HISTORIA</a></li>
<li><a href="/sp/menu">MENÚ</a></li>
<li><a href="/sp/contact">CONTACTO US</a></li>
<li><a href="/sp/order-online">ORDENE POR INTERNET</a></li>
<?php } else { ?>
<li><a href="/">Home</a></li>
<li><a href="/en/our-story">Our Story</a></li>
<li><a href="/en/our-menu">Our Menu</a></li>
<li><a href="/en/contact">Contact Us</a></li>
<li><a href="/en/order">Order Online</a></li>
<?php } ?>
In a url like
http://example.com/#/sp/, the hash#/sp/will never be sent to the server, so you cannot do anything with in PHP unless you interact with the server somehow.See Wikipedia: