<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Amoeba Solution Kiosk &#187; Enterprise Web</title> <atom:link href="http://ask.amoeba.co.in/topics/enterprise-web/feed/" rel="self" type="application/rss+xml" /><link>http://ask.amoeba.co.in</link> <description>Providing solutions for PHP, MySQL, Flash, Flex, Action Script, Javascript, YUI, JQuery, CSS, XHTML problems.</description> <lastBuildDate>Fri, 30 Dec 2011 18:12:55 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>PHP &#8211; How to Get Browser Properties and Capabilities &#8211; get_browser()</title><link>http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/</link> <comments>http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/#comments</comments> <pubDate>Thu, 01 Jul 2010 12:18:15 +0000</pubDate> <dc:creator>Aneeska</dc:creator> <category><![CDATA[Enterprise Web]]></category> <category><![CDATA[PHP/MySQL]]></category> <category><![CDATA[Programming Techniques]]></category> <category><![CDATA[browscap]]></category> <category><![CDATA[browscap.ini]]></category> <category><![CDATA[browser capability]]></category> <category><![CDATA[browser properties]]></category> <category><![CDATA[gary keith]]></category> <category><![CDATA[get_browser]]></category> <category><![CDATA[http_user_agent]]></category> <category><![CDATA[ini]]></category> <category><![CDATA[ismobiledevice]]></category> <category><![CDATA[is_mobile_device]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[mobile application]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php.ini]]></category> <category><![CDATA[web]]></category> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=136</guid> <description><![CDATA[In this tutorial, learn about the get_browser() PHP function and its configuration. We'll learn how to use Gary Keith's browser information database (browscap.ini)  with the PHP browscap directive.
I wanted one of my web applications to have a different appearance on mobile phones and devices. I didn't really want to set up an entirely different domain or use a sub domain particularly for mobile devices (like http://mobile.facebook.com). Instead I want to tackle the device inside my application logic so that all users access the same URL.]]></description> <content:encoded><![CDATA[<p>In this tutorial, learn about the<strong> get_browser()</strong> PHP function and its configuration. We&#8217;ll learn how to use Gary Keith&#8217;s browser information database <strong>(<a
title="A special version of browscap.ini for PHP users " rel="nofollow" href="http://browsers.garykeith.com/downloads.asp" target="_blank">browscap.ini</a>)</strong> with the <strong>PHP browscap directive</strong>.</p><p>I wanted one of my web applications to have a different appearance on mobile phones and devices. I didn&#8217;t really want to set up an entirely different domain or use a sub domain particularly for mobile devices (like http://mobile.facebook.com). Instead I want to tackle the device inside my application logic so that all users access the same URL.</p><p>PHP&#8217;s <span
style="color: #000080;"><strong>$_SERVER['HTTP_USER_AGENT']</strong></span> is cool. You can play around this variable and achieve what you want. But you don&#8217;t get all you want. Let&#8217;s look at the string output of the above variable on my browser:</p><p><strong><em><span
style="color: #993300;">Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6)  Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)</span><br
/> </em></strong></p><p>This gives you some information. I wanted an easy way to see whether the request was from a mobile device.</p><p>PHP has this function, <strong>get_browser</strong> which attempts to determine the capabilities of the  user&#8217;s browser, by looking up the browser&#8217;s information in the <strong><var>browscap.ini</var></strong> file.</p><p>In order for this to work, your <strong>browscap </strong>configuration setting  in <strong><var>php.ini</var></strong> must point to the correct location of the <var>browscap.ini</var> file on your system. <var>browscap.ini</var> is not bundled with PHP, but you may find an  up-to-date <a
title="Link : http://browsers.garykeith.com/downloads.asp" href="http://browsers.garykeith.com/downloads.asp" target="_blank">» php_browscap.ini</a> file  here. While <var>browscap.ini</var> contains information on  many browsers, it relies on user updates to keep the database current.</p><p>First, Download the browscap.ini file for PHP from the above website. There are many files and this is the one you need: <strong><a
title="Gary Keith's browscap.ini for PHP" href="http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI" target="_blank">Gary Keith&#8217;s browscap.ini for PHP</a></strong></p><p>Now, open your PHP.ini file and find for &#8220;browscap&#8221;. You will see something like this:</p><p><span
style="color: #993300;"><strong>[browscap]<br
/> ;browscap = extras\browscap.ini</strong></span></p><p>Remove the semicolon and change the path to point to the <strong>php_browscap.ini</strong> you just downloaded. Your PHP.ini directive now looks like this:</p><p><span
style="color: #993300;"><strong>[browscap]<br
/> browscap = C:\Inetpub\PHP5\extras\php_browscap.ini</strong></span></p><p>Save the PHP.ini file and restart your Web server.</p><p>Now use the get_browser function in your PHP code to get user&#8217;s browser properties and capabilities.</p><pre class="brush: php; html-script: false; title: ; notranslate">
&lt;?php
$browser = get_browser(null, true);
echo &quot;&lt;pre&gt;&quot;;
print_r($browser);
echo &quot;&lt;/pre&gt;&quot;;
?&gt;
</pre><p>This is the output I got when I accessed the script using a Computer Browser.</p><pre class="brush: php; html-script: false; title: ; notranslate">
Array
(
    [browser_name_regex] =&gt; ^mozilla/5\.0 (windows; .*; windows nt 5\.1; .*; rv:1\.9\.2.*) gecko/.* firefox/3\.6.*$
    [browser_name_pattern] =&gt; Mozilla/5.0 (Windows; *; Windows NT 5.1; *; rv:1.9.2*) Gecko/* Firefox/3.6*
    [parent] =&gt; Firefox 3.6
    [platform] =&gt; WinXP
    [win32] =&gt; 1
    [browser] =&gt; Firefox
    [version] =&gt; 3.6
    [majorver] =&gt; 3
    [minorver] =&gt; 6
    [frames] =&gt; 1
    [iframes] =&gt; 1
    [tables] =&gt; 1
    [cookies] =&gt; 1
    [javaapplets] =&gt; 1
    1 =&gt; 1
    [cssversion] =&gt; 3
    [supportscss] =&gt; 1
    [alpha] =&gt;
    [beta] =&gt;
    [win16] =&gt;
    [win64] =&gt;
    [backgroundsounds] =&gt;
    [cdf] =&gt;
    [vbscript] =&gt;
    [activexcontrols] =&gt;
    [isbanned] =&gt;
    [ismobiledevice] =&gt;
    [issyndicationreader] =&gt;
    [crawler] =&gt;
    [aol] =&gt;
    [aolversion] =&gt; 0
)
</pre><p>When I accessed the same script using a mobile phone, here&#8217;s what I got:</p><pre class="brush: php; html-script: false; title: ; notranslate">
Array
(
    [browser_name_regex] =&gt; ^.*nokia.*/.*$
    [browser_name_pattern] =&gt; *Nokia*/*
    [parent] =&gt; Nokia
    [browser] =&gt; Nokia
    [tables] =&gt; 1
    [cookies] =&gt; 1
    [ismobiledevice] =&gt; 1
    [version] =&gt; 0
    [majorver] =&gt; 0
    [minorver] =&gt; 0
    [platform] =&gt; unknown
    [frames] =&gt;
    [iframes] =&gt;
    [javaapplets] =&gt;
    1 =&gt;
    [cssversion] =&gt; 0
    [supportscss] =&gt;
    [alpha] =&gt;
    [beta] =&gt;
    [win16] =&gt;
    [win64] =&gt;
    [backgroundsounds] =&gt;
    [cdf] =&gt;
    [vbscript] =&gt;
    [activexcontrols] =&gt;
    [isbanned] =&gt;
    [ismobiledevice] =&gt;
    [issyndicationreader] =&gt;
    [crawler] =&gt;
    [aol] =&gt;
    [aolversion] =&gt; 0
)
</pre><p>I was just looking at this,</p><pre><span style="color: #993300;"><strong>[ismobiledevice] =&gt; 1</strong></span>
Interesting uh!</pre><p>If your shared hosting service doesn&#8217;t allow you to modify the PHP.INI file, you would want to use a stand alone implementation of the same concept by Jonathan. <a
href="http://code.google.com/p/phpbrowscap/">http://code.google.com/p/phpbrowscap/ </a></p><div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fask.amoeba.co.in%2Fphp-how-to-get-browser-properties-and-capabilities-get_browser%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:65px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/"></g:plusone></div><div
style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/"  data-text="PHP &#8211; How to Get Browser Properties and Capabilities &#8211; get_browser()" data-count="horizontal" data-via="aneesme">Tweet</a></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/" data-counter="right"></script></div><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/"></script></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div>]]></content:encoded> <wfw:commentRss>http://ask.amoeba.co.in/php-how-to-get-browser-properties-and-capabilities-get_browser/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Enhance your Website Performance &#8211; Best Practices</title><link>http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/</link> <comments>http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/#comments</comments> <pubDate>Thu, 22 Apr 2010 14:13:39 +0000</pubDate> <dc:creator>Aneeska</dc:creator> <category><![CDATA[CSS & XHTML]]></category> <category><![CDATA[Enterprise Web]]></category> <category><![CDATA[Javascript & Libraries]]></category> <category><![CDATA[PHP/MySQL]]></category> <category><![CDATA[Programming Techniques]]></category> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=104</guid> <description><![CDATA[Do you think your website is sluggish? Does it take a lot of time to download on to a user computer? Here are some techniques to make your site load faster on user computers and enhance it's performance. These are some of the best practices followed in the Web industry. Implementing these practices has proved that your site will become 20-30% faster. This tutorial is for advanced users and I haven't explained it in detail.]]></description> <content:encoded><![CDATA[<p>Do you think your website is sluggish? Does it take a lot of time to download on to a user computer? Here are some techniques to make your site load faster on user computers and enhance it&#8217;s performance. These are some of the best practices followed in the Web industry. Implementing these practices has proved that your site will become 20-30% faster. This tutorial is for advanced users and I haven&#8217;t explained it in detail.</p><p><strong>Combine all your Javascript files and CSS files in to one file each. </strong><br
/> Normally we include multiple Script files in web pages. You can probably write a PHP script which accepts an array of names of all the script files to be included in the webpage which then fetches the content of the files and creates just one file and passes on to the browser. This doesn&#8217;t reduce the file size. The combined file size is not less than the sum of the sizes of the individual files. But it reduces the number of HTTP requests sent to your server.</p><p>Similarly you can combine all your icon/background images in to a single image and use CSS techniques like &#8220;background-position&#8221; to show different images at different places. Remember each image causes an HTTP request and you can reduce a lot of requests doing this way.</p><p><strong>Use YUI Compressor to minify your Javascrip and CSS files. </strong><br
/> When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced.</p><p><strong>Add Never Expires header for your Javascript and CSS files</strong><br
/> You can use Apaches <strong>mod_expires</strong> module to set Cache-Control header for certain file types. You can configure your apache configuration to add statements like this,<br
/> <em>ExpiresByType image/gif &#8220;access plus 1 months&#8221;</em><br
/> You can add Never expires header for your Javascript and CSS files. If you constantly make changes to your Script and CSS files you will have to rename the files every time you make changes.</p><p><strong>Enable Compression</strong><br
/> Enable compression using Gzip. 90% of the browsers support this. You can compress your text content, xml, script files etc but not images.</p><p><strong>Stylesheets in your header</strong><br
/> Make sure that your style sheets are inside the Head tag.</p><p>These are some simple things you can implement but will obviously enhance your website performance.</p><p>Good luck!</p><div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fask.amoeba.co.in%2Fenhance-your-website-performance-best-practices%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:65px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/"></g:plusone></div><div
style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/"  data-text="Enhance your Website Performance &#8211; Best Practices" data-count="horizontal" data-via="aneesme">Tweet</a></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/" data-counter="right"></script></div><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/"></script></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div>]]></content:encoded> <wfw:commentRss>http://ask.amoeba.co.in/enhance-your-website-performance-best-practices/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Amoeba Solution Kiosk</title><link>http://ask.amoeba.co.in/amoeba-solution-kiosk/</link> <comments>http://ask.amoeba.co.in/amoeba-solution-kiosk/#comments</comments> <pubDate>Sat, 12 Dec 2009 18:35:40 +0000</pubDate> <dc:creator>Aneeska</dc:creator> <category><![CDATA[Enterprise Web]]></category> <category><![CDATA[Social Media]]></category> <category><![CDATA[amoeba]]></category> <category><![CDATA[ask]]></category> <category><![CDATA[kiosk]]></category> <category><![CDATA[questions]]></category> <category><![CDATA[solution]]></category> <category><![CDATA[solutions]]></category> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=1</guid> <description><![CDATA[Amoeba! an innovative Idea House based in Bangalore provides solutions in Web, Software &#038; Media world. The ASK (Amoeba Solution Kiosk) community founded by Amoeba enables and encourages various technology discussions across beginners, experts &#038; the geeks of the Web World. ]]></description> <content:encoded><![CDATA[<p>Amoeba! an innovative Idea House based in Bangalore provides solutions in Web, Software &amp; Media world. The ASK (Amoeba Solution Kiosk) community founded by Amoeba enables and encourages various technology discussions across beginners, experts &amp; the geeks of the Web World.</p><p>Developers can download program modules, source codes, solved problems and can ask questions on various technologies.</p><p><span
style="color: #339966;"><a
title="Ask a Question!" href="/ask/" target="_self"><strong>Ask a Question Now!</strong></a></span></p><div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fask.amoeba.co.in%2Famoeba-solution-kiosk%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:65px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://ask.amoeba.co.in/amoeba-solution-kiosk/"></g:plusone></div><div
style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://ask.amoeba.co.in/amoeba-solution-kiosk/"  data-text="Amoeba Solution Kiosk" data-count="horizontal" data-via="aneesme">Tweet</a></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://ask.amoeba.co.in/amoeba-solution-kiosk/" data-counter="right"></script></div><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ask.amoeba.co.in/amoeba-solution-kiosk/"></script></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div>]]></content:encoded> <wfw:commentRss>http://ask.amoeba.co.in/amoeba-solution-kiosk/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
