Javascript

9
Jul

html5: Get Image Dimension

Get image dimension Using HTML5 with javascript, Its useful for image validation.

Html Code:

[php toolbar=”false” classname=”one_line”] <!–Input file type –>
<input type="file" id="file" />
[/php]

Read more

9
Jul

iPad Detection Using JavaScript or PHP

Here are a few methods by which you can detect iPad browser.

Given that string we can create a few code snippets to determine if the user is being a smug, iPad-using bastard.

1.The PHP

This time we look for the position of “iPad” in the user agent string.

[php toolbar=”true” classname=”one_line”] $isiPad = (bool) strpos($_SERVER[‘HTTP_USER_AGENT’],’iPad’);
[/php]

Read more

9
Jul

Android Detection with JavaScript or PHP

Here are a few methods by which you can detect Android browser.

1.The PHP

Again, we’ll use PHP’s strstr function to search for Android in the user agent:

[php toolbar=”true” classname=”one_line”] $ua = strtolower($_SERVER[‘HTTP_USER_AGENT’]);
if(stripos($ua,’android’) !== false) { // && stripos($ua,’mobile’) !== false) {
header(‘Location: http://android.davidwalsh.name’);
exit();
}
[/php]

Read more