371. nikos(Off) [ 04 Jun 2020, 22:15 ]
ან სხვა ტელეფონები თუ არ გამოვა იყოს სხვა მოწყობილობები [Pasuxi][Cit]|
372. ERT(Off) [ 05 Jun 2020, 1:10 ] ციტატა: nikos
შენ გენაცვალოს შენი გივი სიხარულიძე
<?php
function checkDevice() {
// RETURNS 0 for desktop, 1 for mobile, 2 for tablets
if (is_numeric(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "mobile"))) {
return is_numeric(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "tablet")) ? 2 : 1 ;
} else {
return 0;
}
}
$deviceType = checkDevice();
if ($deviceType==0) {
//DESKTOP
header("location: /enter/them/0 "); exit;//ან ასე გადამისამართება გააკეთე ანდა უკეთესი იქნება თუ პირადაპირ იმ კოდს გადააკეთებ სადაც $_GET_ით ცვლი დიზაინს
} else if ($deviceType==1) {
//PHONE OR MOBILE
header("location: /enter/them/2 "); exit;
} else {
//TABLET";
header("location: /enter/them/1 "); exit;
}
?>