php script in htlm einbinden z.b. automatische Erkennung von Smartphone
Erledigt ! mit javascript
<script type="text/javascript">
if (screen.width <= 730) {
var canRedirect = getCookieValue("canredirect");
if(canRedirect != "no") {
document.location = http://mobile.webseite;
}
document.cookie="canredirect=no";
}
function getCookieValue(key){
currentcookie = document.cookie;
if (currentcookie.length > 0){
firstidx = currentcookie.indexOf(key + "=");
if (firstidx != -1){
firstidx = firstidx + key.length + 1;
lastidx = currentcookie.indexOf(";",firstidx);
if (lastidx == -1){
lastidx = currentcookie.length;
}
return unescape(currentcookie.substring(firstidx, lastidx));
}
}
return "";
}
</script>