php script in htlm einbinden z.b. automatische Erkennung von Smartphone

-stesu2 schrieb am 31.03.2013 um 17:38 Uhr

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>

 

Kommentare

Ehemaliger User schrieb am 31.03.2013 um 18:14 Uhr

html kann man einbinden, aber php wohl nicht, das steht doch aber nei deinem gemieteten Paket dabei was unterstützt wird,