I want to write a program to find out the screen resolutions and if the screen resolution is not equal to 1024*768, I need to show an error.
So by using below script I will get the W and H of screen resolutions.
But I can't compare that. Please see the code I used.
Code: Select all
<?php
$w = '<script language="JavaScript">document.write(Number(screen.width));</script>';
$h = '<script language="JavaScript">document.write(Number(screen.height));</script>';
if($w<1024){
echo "Please set your screen resolution greeter than 1024x768";
}
?>
if I print " var_dump($w) ", it shows as its data type is "string",
So I tried to user (int) to convert type and settype($w,'integer');
But I still not able to compare.
Can you help me to solve this problem.
regards
Jothish