PHP Classes

File: index2.php

Recommend this page to a friend!
  Classes of Harry Kämpf   Mobile Detection   index2.php   Download  
File: index2.php
Role: Example script
Content type: text/plain
Description: example for switch content in the same page
Class: Mobile Detection
Detect mobile devices from request headers
Author: By
Last change: Bug fixing
Date: 9 years ago
Size: 1,435 bytes
 

Contents

Class file image Download
<?PHP
require_once('clsMobileDetection.php');
$strHtml = '';
if (
$objMobile->IsMobile()) {
   
$strHtml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
   
$strHtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'."\n";
   
$strHtml .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">'."\n";
   
$strHtml .= '<head>'."\n";
   
$strHtml .= "\t".'<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" />'."\n";
   
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style_mobile-min.css" />'."\n";
} else {
   
$strHtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
   
$strHtml .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">'."\n";
   
$strHtml .= '<head>'."\n";
   
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style-min.css" media="screen" />'."\n";
   
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style_print-min.css" media="print" />'."\n";
}
echo
$strHtml;
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="de" />
    <meta name="author" content="Harry Kämpf" />
    <link rel="shortcut icon" href="favicon.ico" />
    <title>Your title...</title>
</head>
<body>
</body>
</html>