<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9176502964716205586</id><updated>2024-03-07T23:05:33.888-08:00</updated><category term="PHP"/><category term="Facebook"/><category term="Javascript"/><category term="jQuery"/><category term="How to check browser cookie enabled with php and javascript"/><category term="Jquery validation with custom error message"/><category term="Jquery validation with custom message"/><category term="PHP 5.4 beta1 released"/><category term="PHP oAuth: update status"/><category term="PHP update status"/><category term="Twitter"/><category term="Twitter update status"/><category term="clear facebook cache"/><category term="facebook cache"/><category term="facebook fan page like"/><category term="facebook fan page tab"/><category term="facebook fan page tab creation"/><category term="facebook like button"/><category term="facebook like button event"/><category term="facebook share"/><category term="facebook share button"/><category term="fb share"/><category term="jquery validation"/><category term="query sting in javascript"/><category term="query string"/><category term="share"/><category term="share button"/><category term="track facebook like button event"/><title type='text'>Chandan Sharma</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-8669403840051805969</id><published>2014-04-05T22:07:00.001-07:00</published><updated>2014-04-05T22:07:01.617-07:00</updated><title type='text'>how to check whether element is visible on screen</title><content type='html'>&lt;p&gt;Sometime we need to load some content when that element is visible on browser. So first we need to find whether that element is visible on the browser or not.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;Below is the demo example :&lt;/p&gt;&lt;br/&gt;&lt;pre&gt;Javascript function :&lt;br/&gt;function isVisible(elem)&lt;br/&gt;&lt;br/&gt; var TopView = $(window).scrollTop();&lt;br/&gt; var BotView = TopView + $(window).height();&lt;br/&gt; var TopElement = $(elem).offset().top;&lt;br/&gt; var BotElement = TopElement + $(elem).height();&lt;br/&gt; return ((BotElement &amp;lt;= BotView) &amp;amp;&amp;amp; (TopElement &amp;gt;= TopView));&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;HTML Part : &lt;br/&gt;&lt;code&gt;&lt;br/&gt;&amp;lt;div id=&quot;my_element&quot; class=&quot;no_visible&quot;&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br/&gt;$(window).scroll(function () &lt;br/&gt;&lt;br/&gt;if($(&quot;#my_element&quot;).hasClass(&quot;no_visible&quot;))&lt;br/&gt;isOnView = isVisible(&quot;#my_element&quot;);&lt;br/&gt;if(isOnView)&lt;br/&gt;$(&quot;#my_element&quot;).removeClass(&quot;no_visible&quot;);&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;);&lt;br/&gt;&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;/div&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br/&gt;&lt;div style=&#39;margin:5px 0;float:none;height:100px;&#39; id=&#39;wp_fb_like_button&#39;&gt;&lt;like colorscheme=&#39;light&#39; action=&#39;recommend&#39; font=&#39;arial&#39; show_faces=&#39;true&#39; width=&#39;450&#39; layout=&#39;standard&#39; send=&#39;true&#39; href=&#39;&#39;/&gt;&lt;/div&gt; &lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;20&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1396760812.1253490447998046875000&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/check-element-visible-on-screen/&#39;&gt;how to check whether element is visible on screen &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/8669403840051805969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/8669403840051805969?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8669403840051805969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8669403840051805969'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2014/04/how-to-check-whether-element-is-visible.html' title='how to check whether element is visible on screen'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-3172889765769366497</id><published>2014-02-18T08:50:00.001-08:00</published><updated>2014-02-18T08:50:34.422-08:00</updated><title type='text'>How to check cookie enabled in browser using javascript</title><content type='html'>&lt;p&gt;Its quite simple to find the status of the cookies enabled in browser.&lt;br/&gt;&lt;br/&gt;We can get the status of cookies enabled using below statment:&lt;/p&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;window.navigator.cookieEnabled&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;div style=&#39;margin:5px 0;float:none;height:100px;&#39; id=&#39;wp_fb_like_button&#39;&gt;&lt;like colorscheme=&#39;light&#39; action=&#39;recommend&#39; font=&#39;arial&#39; show_faces=&#39;true&#39; width=&#39;450&#39; layout=&#39;standard&#39; send=&#39;true&#39; href=&#39;&#39;/&gt;&lt;/div&gt; &lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;20&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1392742223.4454009532928466796875&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/check-cookie-enabled-browser-javascript/&#39;&gt;How to check cookie enabled in browser using javascript&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/3172889765769366497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/3172889765769366497?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/3172889765769366497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/3172889765769366497'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2014/02/how-to-check-cookie-enabled-in-browser.html' title='How to check cookie enabled in browser using javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-8875813465698706856</id><published>2014-02-17T09:31:00.001-08:00</published><updated>2014-02-17T09:55:18.581-08:00</updated><title type='text'>Detect Mobile device through javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Detect Mobile device through javascript&lt;br /&gt;
&lt;br /&gt;
A pretty simple solution is to check for mobile device is the screen width. Almost all mobile devices have a max screen width of 480px.&lt;br /&gt;
&lt;br /&gt;
We can get the screen width using below statement:&lt;br /&gt;
&lt;br /&gt;
var screen_width = window.screen.availWidth;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The only exceptions are tablet pc&#39;s like the ipad. These devices have a higher screen width than smartphones. We can use browsers user agent to determine whether this is a mobile device or not.&lt;br /&gt;
&lt;br /&gt;
Below is the function to determine the mobile device based on user-agent:&lt;br /&gt;
&lt;br /&gt;
(function(a){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; })(navigator.userAgent||navigator.vendor||window.opera);&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/8875813465698706856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/8875813465698706856?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8875813465698706856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8875813465698706856'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2014/02/detect-mobile-device-through-javascript.html' title='Detect Mobile device through javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2117130368991747138</id><published>2014-01-24T10:57:00.001-08:00</published><updated>2014-01-24T10:57:00.792-08:00</updated><title type='text'>base64 encode using javascript</title><content type='html'>&lt;p&gt;We can encode any string to a encoded data (using base-64 encoding) string.&lt;br/&gt;&lt;br/&gt;The btoa() method of window object used to to a encoded data (using base-64 encoding) string. &lt;/p&gt;&lt;br/&gt;&lt;p&gt;Example :&lt;/p&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;window.btoa(&#39;Hello World !!!&#39;);&lt;br/&gt;&lt;br/&gt;Output : SGVsbG8gV29ybGQgISEh&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;div style=&#39;margin:5px 0;float:none;height:100px;&#39; id=&#39;wp_fb_like_button&#39;&gt;&lt;like colorscheme=&#39;light&#39; action=&#39;recommend&#39; font=&#39;arial&#39; show_faces=&#39;true&#39; width=&#39;450&#39; layout=&#39;standard&#39; send=&#39;true&#39; href=&#39;&#39;/&gt;&lt;/div&gt; &lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;20&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1390589803.8119490146636962890625&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/base64-encode-javascript/&#39;&gt;base64 encode using javascript&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2117130368991747138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2117130368991747138?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2117130368991747138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2117130368991747138'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2014/01/base64-encode-using-javascript.html' title='base64 encode using javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-1417167796415238974</id><published>2013-12-21T07:51:00.001-08:00</published><updated>2013-12-21T07:51:19.980-08:00</updated><title type='text'>cookie and subdomains</title><content type='html'>&lt;p&gt;A cookie can be set either for a specific domain or a domain and its subdomain.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;&lt;strong&gt;Cookie for a specific domain:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;When you set a cookie from a web server in php using setcookie() function then this function accepts some parameters. Some parameters are required and some are optional. In those parameters there is one parameter called domain, which means this cookie would be available for that domain. Domain parameter is an optional parameter.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;If you don’t set the domain in setcookie() function then it will set the cookie which would be available to current host only. It won’t be available its subdomain.&lt;/p&gt;&lt;br/&gt;&lt;pre&gt;setcookie(&quot;TestCookie&quot;, $value, time()+3600);&lt;/pre&gt;&lt;br/&gt;&lt;p&gt;&lt;strong&gt;Cookie for domain and subdomains:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;If you set the domain (top level domain) name in setcookie() function then it will set the cookie which would be availabe to its domain and subdomains.&lt;br/&gt;&lt;br/&gt;For ex.&lt;/p&gt;&lt;br/&gt;&lt;pre&gt;setcookie(&quot;TestCookie&quot;, $value, time()+3600,&#39;example.com&#39;);&lt;/pre&gt;&lt;br/&gt;&lt;p&gt;Above function will set the cookie with the domain “.example.com”. This cookie would be available to all its subdomains like www.example.com, subdomain.example.com&lt;/p&gt;&lt;br/&gt;&lt;p&gt; &lt;/p&gt;&lt;br/&gt;&lt;div style=&#39;margin:5px 0;float:none;height:100px;&#39; id=&#39;wp_fb_like_button&#39;&gt;&lt;like colorscheme=&#39;light&#39; action=&#39;&#39; font=&#39;arial&#39; show_faces=&#39;true&#39; width=&#39;450&#39; layout=&#39;like&#39; send=&#39;false&#39; href=&#39;&#39;/&gt;&lt;/div&gt; &lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;4&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1387641077.7950580120086669921875&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/cookie-subdomains/&#39;&gt;cookie and subdomains&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/1417167796415238974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/1417167796415238974?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/1417167796415238974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/1417167796415238974'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2013/12/cookie-and-subdomains.html' title='cookie and subdomains'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-1361752854978402573</id><published>2013-11-30T11:39:00.001-08:00</published><updated>2013-11-30T11:39:45.839-08:00</updated><title type='text'>PHP Best Practise</title><content type='html'>&lt;ul&gt;&lt;li&gt;Always use PHP standard tags i.e.  &amp;lt;?php ?&amp;gt; .  To ensure the future version support, Please use standard tags for PHP.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always follow a consistent naming standards.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always use Indent and white spaces in codes. It helps to read and understand the code.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always turn on the full error reporting for development. It will show you complete list of notices, warnings and errors. When you are sending you code to production, Please make sure that you have turn off the error reporting else problems would be visible to users.  You can turn on the error reporting by php.ini. error reporting can be enabled on runtime by error_reporting() function.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always do the client and server side validation wherever there is scope of user input. You can not trust on your users.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always put comment in your code. It will make it easy to understand to others.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;You should use caching mechanism for the performance of the site. Ex.- memcache&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Don’t do the deep nesting. It will make the code complicated.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Always avoid to declare more variables. It will improve the performance of the applicatio&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;div style=&#39;margin:5px 0;float:none;height:100px;&#39; id=&#39;wp_fb_like_button&#39;&gt;&lt;like colorscheme=&#39;light&#39; action=&#39;&#39; font=&#39;arial&#39; show_faces=&#39;true&#39; width=&#39;450&#39; layout=&#39;like&#39; send=&#39;false&#39; href=&#39;&#39;/&gt;&lt;/div&gt; &lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;4&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1385840374.1784839630126953125000&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/php-practise/&#39;&gt;PHP Best Practise&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/1361752854978402573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/1361752854978402573?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/1361752854978402573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/1361752854978402573'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2013/11/php-best-practise.html' title='PHP Best Practise'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-5311078418278183377</id><published>2013-11-12T06:22:00.001-08:00</published><updated>2013-11-12T06:22:41.368-08:00</updated><title type='text'>Output buffering in php</title><content type='html'>&lt;p&gt;Output buffering is used by PHP to improve performance and to perform a few tricks.&lt;br/&gt;&lt;br/&gt;Without output buffering (the default), your HTML is sent to the browser in pieces as PHP processes through your script. With output buffering, your HTML is stored in a variable and sent to the browser as one piece at the end of your script.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;Advantages of output buffering:&lt;/p&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Turning on output buffering alone decreases the amount of time it takes to download and render our HTML because it’s not being sent to the browser in pieces as PHP processes the HTML.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;All the fancy stuff we can do with PHP strings, we can now do with our whole HTML page as one variable.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;If you’ve ever encountered the message “Warning: Cannot modify header information – headers already sent by (output)” while setting cookies, you’ll be happy to know that output buffering is your answer.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;h3&gt;Use Facebook to Comment on this Post&lt;/h3&gt;&lt;br/&gt; &lt;div id=&#39;fb-root&#39;/&gt;&lt;comments width=&#39;548&#39; num_posts=&#39;4&#39; href=&#39;http://codinghint.com/wp-cron.php?doing_wp_cron=1384266156.7429769039154052734375&#39;/&gt;&lt;br/&gt;&lt;a href=&#39;http://codinghint.com/output-buffering-php/&#39;&gt;Output buffering in php&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/5311078418278183377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/5311078418278183377?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5311078418278183377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5311078418278183377'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2013/11/output-buffering-in-php.html' title='Output buffering in php'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-5260218516543324570</id><published>2013-10-29T11:59:00.001-07:00</published><updated>2013-10-29T12:05:07.088-07:00</updated><title type='text'>Ternary Operators</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This operator takes three arguments – a condition, a result for true, and a result for false.&lt;br /&gt;
&lt;br /&gt;
It is a shortcut of doing if statements. Here’s an example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $result = ($a &amp;lt; 16) ? &#39;true&#39; : &#39;false&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($a &amp;lt; 16) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $result = &#39;true&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $result = &#39;false&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;
Use Facebook to Comment on this Post&lt;/h3&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;comments href=&quot;http://codinghint.com/wp-cron.php?doing_wp_cron=1383073153.4813029766082763671875&quot; num_posts=&quot;4&quot; width=&quot;548&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://codinghint.com/ternary-operators/&quot;&gt;Ternary Operators&lt;/a&gt;&lt;/comments&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/5260218516543324570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/5260218516543324570?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5260218516543324570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5260218516543324570'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2013/10/ternary-operators.html' title='Ternary Operators'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-6158677215398217812</id><published>2011-10-18T22:55:00.000-07:00</published><updated>2011-10-18T22:55:19.514-07:00</updated><title type='text'>Cheat Sheets &amp; Quick Reference Cards for Developers | DevCheatSheet.com</title><content type='html'>&lt;a href=&quot;http://devcheatsheet.com/#.Tp5mOvXlWvd.blogger&quot;&gt;Cheat Sheets &amp;amp; Quick Reference Cards for Developers | DevCheatSheet.com&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/6158677215398217812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/6158677215398217812?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/6158677215398217812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/6158677215398217812'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/10/cheat-sheets-quick-reference-cards-for.html' title='Cheat Sheets &amp; Quick Reference Cards for Developers | DevCheatSheet.com'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2613677134746538713</id><published>2011-10-13T22:53:00.000-07:00</published><updated>2011-10-13T22:53:32.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP 5.4 beta1 released"/><title type='text'>PHP 5.4 beta1 released</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;The PHP development team announced the first beta release of PHP 5.4. &lt;br /&gt;
PHP 5.4 includes new language features and removes several legacy (deprecated) behaviors.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!&lt;/strong&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2613677134746538713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2613677134746538713?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2613677134746538713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2613677134746538713'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/10/php-54-beta1-released.html' title='PHP 5.4 beta1 released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Mumbai, Maharashtra, India</georss:featurename><georss:point>19.0176147 72.856164400000011</georss:point><georss:box>18.826811199999998 72.7533269 19.2084182 72.959001900000018</georss:box></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-7927009142544111929</id><published>2011-09-30T12:19:00.000-07:00</published><updated>2011-10-06T07:02:09.554-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to check browser cookie enabled with php and javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>How to check browser cookie enabled with php and javascript</title><content type='html'>Cookies are typically used by web servers to perform functions such as tracking your visits to websites, enabling you to log in to sites, and storing your shopping cart. Cookies can be used to interaction between Javascript and Server Side Scripts like PHP.Cookies also used to transfer small amount of data between one page to other pages via HTTP headers .If user disables this cookies or user’s browser won’t support the interaction between JS and PHP fails.So we must ensure user must enable these Cookies.&lt;br/&gt;&lt;strong&gt;Checking with Javascript&lt;/strong&gt;&lt;br/&gt;&lt;pre&gt;if (navigator.cookieEnabled == 0) {&lt;br/&gt;alert(&quot;You need to enable cookies for this site to load properly!&quot;);&lt;br/&gt;}&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Checking with PHP&lt;/strong&gt;&lt;br/&gt;If user disables Javascript we fail to check the Cookie enabled or not.So we check on the server side also.below PHP snippet check the Cookie enabled or not.&lt;br/&gt;&lt;pre&gt;function check_cookie(){&lt;br/&gt;if (setcookie(&quot;test&quot;, &quot;test&quot;, time() + 360))&lt;br/&gt;{&lt;br/&gt;if (isset ($_COOKIE[&#39;test&#39;]))&lt;br/&gt;{&lt;br/&gt;return true;&lt;br/&gt;}&lt;br/&gt;}&lt;br/&gt;return false;&lt;br/&gt;}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/7927009142544111929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/7927009142544111929?isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/7927009142544111929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/7927009142544111929'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/09/how-to-check-browser-cookie-enabled.html' title='How to check browser cookie enabled with php and javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-8719019072184205776</id><published>2011-08-23T22:37:00.000-07:00</published><updated>2011-10-06T07:02:09.554-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHP 5.3.8 Released!</title><content type='html'>All PHP users should note that the PHP 5.2 series is NOT supported anymore. All users are strongly encouraged to upgrade to PHP 5.3.8.</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/8719019072184205776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/8719019072184205776?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8719019072184205776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8719019072184205776'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/php-538-released.html' title='PHP 5.3.8 Released!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-3936258810578880729</id><published>2011-08-19T02:04:00.000-07:00</published><updated>2011-10-06T07:02:09.554-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHP Programming Tips</title><content type='html'>&lt;strong&gt;Functions And Methods&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; Function And Method Calling&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;call_user_func() is 54% slower than just calling the function&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;call_user_func() is 59% slower than calling a static method&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;call_user_func() is 65% slower than calling an object method&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;function() is 119% faster than static::method()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;$this-&amp;gt;method() is 116% faster than static::method()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;declared static::method() is 93% faster than static::method()&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;strong&gt;Functions General&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;Pass by reference is 3% faster than Return by reference&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;No reference is 1.7% faster than Return by reference&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/3936258810578880729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/3936258810578880729?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/3936258810578880729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/3936258810578880729'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/php-programming-tips_19.html' title='PHP Programming Tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-8101344251813805916</id><published>2011-08-19T02:01:00.000-07:00</published><updated>2011-10-06T07:02:09.554-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHP Programming Tips</title><content type='html'>&lt;strong&gt;Variable Operations&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;Operating on an initialized variable is 376% faster than operating on an unitialized variable.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Constants are 146% slower than variables&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Local variables are 9.9% faster than global variables&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;strong&gt;String Functions&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&#39;String&#39; is 0.26% faster than &quot;String&quot;&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&quot;String&quot; is 4% faster than HEREDOC syntax&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&quot;String\n&quot; is 108% faster than &#39;String&#39;.&quot;\n&quot;&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&#39;String&#39;.$var is 28% faster than &quot;String$var&quot;&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&#39;string &#39;.$var.&#39; string&#39; is 55% faster than sprintf(&#39;string %s string&#39;, $var)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&quot;\n&quot; is 70% faster than chr(10)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strnatcmp() is 4.95% faster than strcmp()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strcasecmp() is 45% faster than preg_match()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strcasecmp() is 6.6% faster than strtoupper($string) == &quot;STRING&quot;&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strcasecmp() is 13% faster than strnatcasecmp()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strtr($string, $string1, $string2) is 10% faster than str_replace()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;str_replace() is 161% faster than strtr($string, $array)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;stristr() is 10% faster than stripos()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;strpos() is 9.7% faster than strstr()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;isset($str{5}) is 176% faster than strlen($str) &amp;gt; 5&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;str_replace($str, $str, $str) twice is 17% faster than str_replace(array, array, string)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;list() = explode() is 13% faster than substr($str, strpos($str))&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;strong&gt;Numeric Functions&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;++$int is 10% faster than $int++&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;(float) is 48% faster than settype($var, &#39;float&#39;)&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;strong&gt;Array Functions&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;list() = $array; is 3.4% faster than assigning each variable&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;in_array() is 6% faster than array_search&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;isset($array[$key]) is 230% faster than array_key_exists()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;!empty($array) is 66% faster than count($array)&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;strong&gt;Output Functions&lt;/strong&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;echo is 5% faster than print()&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;echo &#39; &#39;.&#39; &#39; is 0.44% faster than echo &#39; &#39;,&#39; &#39;&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/8101344251813805916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/8101344251813805916?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8101344251813805916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8101344251813805916'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/php-programming-tips.html' title='PHP Programming Tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2015880170623932918</id><published>2011-08-16T23:38:00.000-07:00</published><updated>2011-10-06T07:00:37.655-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>How to get the number of parameter with their name of a defined function</title><content type='html'>You can get the number of parameters with their name of a function.&lt;br/&gt;&lt;br/&gt;PHP provides a class ReflectionFunction. It&#39;s a built-in class, so no &lt;br/&gt;need to add any extra library.&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&amp;lt;?php&lt;br/&gt;function get_func_argNames($funcName) {&lt;br/&gt;    $f = new ReflectionFunction($funcName);&lt;br/&gt;    $result = array();&lt;br/&gt;    foreach ($f-&amp;gt;getParameters() as $param) {&lt;br/&gt;        $result[] = $param-&amp;gt;name;   &lt;br/&gt;    }&lt;br/&gt;    return $result;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;print_r(get_func_argNames(&#39;get_func_argNames&#39;));&lt;br/&gt;&lt;br/&gt;?&amp;gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2015880170623932918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2015880170623932918?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2015880170623932918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2015880170623932918'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/how-to-get-number-of-parameter-with.html' title='How to get the number of parameter with their name of a defined function'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-5289653812426185318</id><published>2011-08-05T02:47:00.000-07:00</published><updated>2011-10-06T06:59:52.570-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook fan page like"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook fan page tab"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook fan page tab creation"/><title type='text'>Check If The User Likes (Fan Of) Your Facebook Page When Landing On&#xa;Your Page Tab</title><content type='html'>&lt;div&gt;&lt;br/&gt;&lt;div&gt;Check when user landed on facebook fan page tab, Wheather he is fan of this page or not ?&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;br/&gt;&lt;br/&gt;A lot of developers and admins Facebook pages don’t know that they can detect whether the visiting user is already a fan of the page or not.&lt;br/&gt;&lt;br/&gt;When the user visit your Page Tab, Facebook will send you the usual signed_request but with additional parameter called &lt;strong&gt;page&lt;/strong&gt;.&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;blockquote&gt;&lt;br/&gt;&lt;pre&gt;When a user navigates to the Facebook Page, they will see your Page Tab&lt;br/&gt; added in the next available tab position. Broadly, a Page Tab is &lt;br/&gt;loaded in exactly the same way as a Canvas Page. When a user selects &lt;br/&gt;your Page Tab, you will received the signed_request parameter with &lt;br/&gt;one additional parameter, page. This parameter contains a JSON object &lt;br/&gt;with an id (the page id of the current page), admin  (if the user is a &lt;br/&gt;admin of the page), and liked (if the user has liked the page). &lt;br/&gt;As with a Canvas Page, you will not receive all the user information &lt;br/&gt;accessible to your app in the signed_request until the user authorizes &lt;br/&gt;your app.&lt;/pre&gt;&lt;br/&gt;&lt;/blockquote&gt;&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;blockquote&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;&amp;lt;?php&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;$signed_request&lt;/code&gt; &lt;code&gt;= &lt;/code&gt;&lt;code&gt;$_REQUEST&lt;/code&gt;&lt;code&gt;[&lt;/code&gt;&lt;code&gt;&quot;signed_request&quot;&lt;/code&gt;&lt;code&gt;];&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;list(&lt;/code&gt;&lt;code&gt;$encoded_sig&lt;/code&gt;&lt;code&gt;, &lt;/code&gt;&lt;code&gt;$payload&lt;/code&gt;&lt;code&gt;) = &lt;/code&gt;&lt;code&gt;explode&lt;/code&gt;&lt;code&gt;(&lt;/code&gt;&lt;code&gt;&#39;.&#39;&lt;/code&gt;&lt;code&gt;, &lt;/code&gt;&lt;code&gt;$signed_request&lt;/code&gt;&lt;code&gt;, 2);&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;$data&lt;/code&gt; &lt;code&gt;= json_decode(&lt;/code&gt;&lt;code&gt;base64_decode&lt;/code&gt;&lt;code&gt;(&lt;/code&gt;&lt;code&gt;strtr&lt;/code&gt;&lt;code&gt;(&lt;/code&gt;&lt;code&gt;$payload&lt;/code&gt;&lt;code&gt;, &lt;/code&gt;&lt;code&gt;&#39;-_&#39;&lt;/code&gt;&lt;code&gt;, &lt;/code&gt;&lt;code&gt;&#39;+/&#39;&lt;/code&gt;&lt;code&gt;)), true);&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;if&lt;/code&gt; &lt;code&gt;(&lt;/code&gt;&lt;code&gt;empty&lt;/code&gt;&lt;code&gt;(&lt;/code&gt;&lt;code&gt;$data&lt;/code&gt;&lt;code&gt;[&lt;/code&gt;&lt;code&gt;&quot;page&quot;&lt;/code&gt;&lt;code&gt;][&lt;/code&gt;&lt;code&gt;&quot;liked&quot;&lt;/code&gt;&lt;code&gt;])) {&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;    &lt;/code&gt;&lt;code&gt;echo&lt;/code&gt; &lt;code&gt;&quot;You are not a fan!&quot;&lt;/code&gt;&lt;code&gt;;&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;} &lt;/code&gt;&lt;code&gt;else&lt;/code&gt; &lt;code&gt;{&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;    &lt;/code&gt;&lt;code&gt;echo&lt;/code&gt; &lt;code&gt;&quot;Welcome back fan!&quot;&lt;/code&gt;&lt;code&gt;;&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;&lt;br/&gt;&lt;div&gt;&lt;code&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/5289653812426185318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/5289653812426185318?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5289653812426185318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5289653812426185318'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/check-if-user-likes-fan-of-your.html' title='Check If The User Likes (Fan Of) Your Facebook Page When Landing On&#xa;Your Page Tab'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-7221830527658680285</id><published>2011-08-01T23:57:00.000-07:00</published><updated>2011-10-06T07:00:37.656-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook like button"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook like button event"/><category scheme="http://www.blogger.com/atom/ns#" term="track facebook like button event"/><title type='text'>Track Facebook Like Button Event</title><content type='html'>&lt;strong&gt;Why Track Facebook Like Button Event&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Lets take an example of any online Store.&lt;br/&gt;&lt;br/&gt;We want to show some coupon code, when user Like my Product.&lt;br/&gt;In That case we need to &#39;&#39;&#39;Track Facebook Like Button Event&#39;&#39;&#39;.&lt;br/&gt;&lt;br/&gt;&#39;&#39;&#39;We can track the Facebook like Activity  &#39;&#39;&#39;&lt;br/&gt;To Track the Activity following Points are Important:&lt;br/&gt;&lt;ol&gt;&lt;br/&gt;	&lt;li&gt;We can Track Facebook Like button Click only by XFBML Method.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&#39;&#39;&#39;FB.Event.subscribe&#39;&#39;&#39; Method is used to Track the Like and Unlike.&lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br/&gt;&lt;code&gt;&lt;br/&gt;&amp;lt;html&amp;gt;&lt;br/&gt;&amp;lt;head&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery-latest.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=197607353625066&amp;amp;amp;xfbml=1&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br/&gt;$(document).ready(function() {&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;window.fbAsyncInit = function() {&lt;br/&gt;FB.init({appId: &#39;&#39;, status: true, cookie: true, xfbml: true});&lt;br/&gt;FB.Event.subscribe(&#39;edge.create&#39;, function(href, widget) {&lt;br/&gt;$(&#39;#response&#39;).html(&#39;You have subscribed it.&#39;);&lt;br/&gt;});&lt;br/&gt;FB.Event.subscribe(&#39;edge.remove&#39;, function(href, widget) {&lt;br/&gt;$(&#39;#response&#39;).html(&#39;you have unsubscribed it.&#39;);&lt;br/&gt;});&lt;br/&gt;};&lt;br/&gt;});&lt;br/&gt;&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;/head&amp;gt;&lt;br/&gt;&amp;lt;body&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;div id=&quot;response&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br/&gt;&amp;lt;div id=&quot;fb-root&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br/&gt;&amp;lt;fb:like href=&quot;http://subjekt.com&quot; send=&quot;false&quot; width=&quot;450&quot; show_faces=&quot;false&quot; font=&quot;&quot;&amp;gt;&amp;lt;/fb:like&amp;gt;&lt;br/&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;&amp;lt;/html&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;This Method executes when you Perform Like Activity.&lt;/strong&gt;&lt;br/&gt;&lt;code&gt;&lt;br/&gt;FB.Event.subscribe(&#39;edge.create&#39;, function(href, widget) {&lt;br/&gt;$(&#39;#response&#39;).html(&#39;You have subscribed it.&#39;);&lt;br/&gt;});&lt;br/&gt;&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;This Method executes when you Perform UnLike Activity.&lt;/strong&gt;&lt;br/&gt;&lt;code&gt;&lt;br/&gt;FB.Event.subscribe(&#39;edge.remove&#39;, function(href, widget) {&lt;br/&gt;$(&#39;#response&#39;).html(&#39;you have unsubscribed it.&#39;);&lt;br/&gt;});&lt;br/&gt;&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/7221830527658680285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/7221830527658680285?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/7221830527658680285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/7221830527658680285'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/08/track-facebook-like-button-event.html' title='Track Facebook Like Button Event'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2451034885254407344</id><published>2011-06-18T02:34:00.000-07:00</published><updated>2011-10-06T07:00:37.656-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How To Develop a jQuery Plugin</title><content type='html'>&lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; is the most popular JavaScript library and many sites adopt it for dynamic effects and Ajax functionality. However, relatively few developers delve into the depths of plugin development.&lt;br/&gt;&lt;h5&gt;Why Create a jQuery Plugin?&lt;/h5&gt;&lt;br/&gt;In a word: re-use. By extending jQuery, you create reusable components that can be used on any web page. Your code is encapsulated and there is less risk that you will use the same function names elsewhere.&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;h5&gt;How jQuery Works&lt;/h5&gt;&lt;br/&gt;At its core, jQuery is passed DOM elements or a string containing a CSS selector. It returns a jQuery object, which is an array-like collection of DOM nodes. One or more methods can then be &lt;em&gt;chained&lt;/em&gt; to this set of nodes, e.g.&lt;br/&gt;// color all &amp;lt;p&amp;gt; tags red&lt;br/&gt;$(&quot;p&quot;).css(&quot;color&quot;, &quot;red&quot;);&lt;br/&gt;&lt;br/&gt;Note: although the jQuery library is named ‘jQuery’, ‘$’ is a shortcut variable that references it. Be aware that other libraries can grab ‘$’ for themselves.&lt;br/&gt;&lt;h5&gt;How jQuery Plugins Work&lt;/h5&gt;&lt;br/&gt;jQuery allows methods to be added to its library. When called, these methods are passed the jQuery object within the JavaScript ‘this’ object. The DOM nodes can be manipulated as required and the method should return ‘this’ so other functions can be chained.&lt;br/&gt;&lt;br/&gt;Our example plugin will be called using code such as:&lt;br/&gt;&lt;br/&gt;// reverse the text in all &amp;lt;p&amp;gt; tags&lt;br/&gt;$(&quot;p&quot;).reverseText();&lt;br/&gt;&lt;br/&gt;We will also add two optional parameters, minlength and maxlength. When defined, the string length must fall between these limits for the reversal to occur.&lt;br/&gt;&lt;h5&gt;The Plugin Declaration&lt;/h5&gt;&lt;br/&gt;Plugins are defined using the jQuery fn function, e.g.&lt;br/&gt;&lt;br/&gt;jQuery.fn.reverseText = function(params) { ... };&lt;br/&gt;&lt;br/&gt;Using ‘jQuery’ rather than ‘$’ ensures there are no conflicts with other JavaScript libraries. All our internal code should also refer to ‘jQuery’ rather than ‘$’. However, we can save a little typing and reduce the file size using an anonymous function:&lt;br/&gt;&lt;br/&gt;(function($) {&lt;br/&gt;$.fn.reverseText = function(params) { ... };&lt;br/&gt;})(jQuery);&lt;br/&gt;&lt;br/&gt;This function runs immediately and is passed jQuery as a parameter named ‘$’. Since ‘$’ is a local variable, we can assume that it always refers to the jQuery library rather than another library that grabbed the global ‘$’ variable first.&lt;br/&gt;&lt;h5&gt;Plugin Parameters&lt;/h5&gt;&lt;br/&gt;We require two parameters for our plugin: minlength and maxlength. It is easiest to define these as function arguments, e.g.&lt;br/&gt;&lt;br/&gt;(function($) {&lt;br/&gt;$.fn.reverseText = function(minlength, maxlength) { ... };&lt;br/&gt;})(jQuery);&lt;br/&gt;// example&lt;br/&gt;$(&quot;p&quot;).reverseText(0, 100);&lt;br/&gt;&lt;br/&gt;But what if we decide to add further parameters later? Our plugin could have dozens of options — parameter handling would quickly become convoluted. As an alternative, we could pass a single JSON object, e.g.&lt;br/&gt;&lt;br/&gt;(function($) {&lt;br/&gt;$.fn.reverseText = function(params) { ... }&lt;br/&gt;})(jQuery);&lt;br/&gt;// example&lt;br/&gt;$(&quot;p&quot;).reverseText( { minlength: 0, maxlength: 100 } );&lt;br/&gt;&lt;br/&gt;The first line in our reverseText function should define a set of default parameters then &lt;em&gt;overwrite&lt;/em&gt; these with any user-defined values. The jQuery extend function can handle this for us:&lt;br/&gt;&lt;br/&gt;// merge default and user parameters&lt;br/&gt;params = $.extend( {minlength: 0, maxlength: 99999}, params);&lt;br/&gt;&lt;br/&gt;Therefore, &lt;strong&gt;params.minlength&lt;/strong&gt; is 0 and &lt;strong&gt;params.maxlength&lt;/strong&gt; is 99999 unless the calling code overrides those values.&lt;br/&gt;&lt;h5&gt;The Plugin Code&lt;/h5&gt;&lt;br/&gt;We can now write our main plugin code:&lt;br/&gt;&lt;br/&gt;// traverse all nodes&lt;br/&gt;this.each(function() {&lt;br/&gt;// express a single node as a jQuery object&lt;br/&gt;var $t = $(this);&lt;br/&gt;// find text&lt;br/&gt;var origText = $t.text(), newText = &#39;&#39;;&lt;br/&gt;// text length within defined limits?&lt;br/&gt;if (origText.length &amp;gt;= params.minlength &amp;amp;&amp;amp;  origText.length &amp;lt;= params.maxlength) {&lt;br/&gt;// reverse text&lt;br/&gt;for (var i = origText.length-1; i &amp;gt;= 0; i--) newText += origText.substr(i, 1);&lt;br/&gt;$t.text(newText);&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;});&lt;br/&gt;&lt;br/&gt;Explanation:&lt;br/&gt;&lt;ol&gt;&lt;br/&gt;	&lt;li&gt;The this.each function traverses all the jQuery DOM nodes and calls an anonymous function.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Within the function, ‘this’ contains a single node. A jQuery node collection is assigned to $t so we can run jQuery methods.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;The variable origText is assigned the text string within the DOM node. newText is set to an empty string.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;If the length of origText falls between params.minlength and params.maxlength, the loop creates a reversed text string in newText. The DOM node is then updated accordingly.&lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;&lt;h5&gt;Don’t Break the Chain!&lt;/h5&gt;&lt;br/&gt;Finally, we should remember to return the jQuery object so other methods can be chained:&lt;br/&gt;&lt;br/&gt;return this;&lt;br/&gt;&lt;h5&gt;The Completed Code&lt;/h5&gt;&lt;br/&gt;Our plugin code is now complete:&lt;br/&gt;&lt;br/&gt;(function($) {&lt;br/&gt;// jQuery plugin definition&lt;br/&gt;$.fn.reverseText = function(params) {&lt;br/&gt;// merge default and user parameters&lt;br/&gt;params = $.extend( {minlength: 0, maxlength: 99999}, params);&lt;br/&gt;// traverse all nodes&lt;br/&gt;this.each(function() {&lt;br/&gt;// express a single node as a jQuery object&lt;br/&gt;var $t = $(this);&lt;br/&gt;// find text&lt;br/&gt;var origText = $t.text(), newText = &#39;&#39;;&lt;br/&gt;// text length within defined limits?&lt;br/&gt;if (origText.length &amp;gt;= params.minlength &amp;amp;&amp;amp;  origText.length &amp;lt;= params.maxlength) {&lt;br/&gt;// reverse text&lt;br/&gt;for (var i = origText.length-1; i &amp;gt;= 0; i--) newText += origText.substr(i, 1);&lt;br/&gt;$t.text(newText);&lt;br/&gt;}&lt;br/&gt;});&lt;br/&gt;// allow jQuery chaining&lt;br/&gt;return this;&lt;br/&gt;};&lt;br/&gt;})(jQuery);&lt;br/&gt;&lt;br/&gt;This file is saved as jquery.reversetext.js. We can then include it in any HTML page after the jQuery library has loaded, e.g.&lt;br/&gt;&lt;br/&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;&lt;br/&gt;&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br/&gt;&amp;lt;head&amp;gt;&lt;br/&gt;&amp;lt;title&amp;gt;jQuery plugin: reverseText demonstration&amp;lt;/title&amp;gt;&lt;br/&gt;&amp;lt;/head&amp;gt;&lt;br/&gt;&amp;lt;body&amp;gt;&lt;br/&gt;&amp;lt;h1&amp;gt;jQuery plugin: reverseText&amp;lt;/h1&amp;gt;&lt;br/&gt;&amp;lt;p&amp;gt;This jQuery plugin reverses all the text in the selected nodes.&amp;lt;/p&amp;gt;&lt;br/&gt;&amp;lt;ul&amp;gt;&lt;br/&gt;&amp;lt;li&amp;gt;This text will be reversed&amp;lt;/li&amp;gt;&lt;br/&gt;&amp;lt;li&amp;gt;This text will not be reversed&amp;lt;/li&amp;gt;&lt;br/&gt;&amp;lt;li&amp;gt;reversed&amp;lt;/li&amp;gt;&lt;br/&gt;&amp;lt;li&amp;gt;not reversed&amp;lt;/li&amp;gt;&lt;br/&gt;&amp;lt;/ul&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.reversetext.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br/&gt;// reverse even-numbered LI tag text&lt;br/&gt;$(&quot;ul li:even&quot;).reverseText();&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;&amp;lt;/html&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2451034885254407344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2451034885254407344?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2451034885254407344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2451034885254407344'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/06/how-to-develop-jquery-plugin.html' title='How To Develop a jQuery Plugin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-930407559497332809</id><published>2011-06-16T04:04:00.000-07:00</published><updated>2011-10-06T07:00:37.656-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook share"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook share button"/><category scheme="http://www.blogger.com/atom/ns#" term="fb share"/><category scheme="http://www.blogger.com/atom/ns#" term="share"/><category scheme="http://www.blogger.com/atom/ns#" term="share button"/><title type='text'>Add a &amp;quot;Share on Facebook&amp;quot; button to a webpage.</title><content type='html'>&lt;strong&gt;Copy the script for the style you&#39;d like&lt;/strong&gt;:&lt;br/&gt;&lt;br/&gt;Copy and paste the following code blocks into your site and replace &#39;&#39; with the link you want to Share.&lt;br/&gt;&lt;br/&gt;Text link:&lt;br/&gt;&lt;br/&gt;&amp;lt;script&amp;gt;function fbs_click() {u=location.href;t=document.title;window.open(&#39;http://www.facebook.com/sharer.php?u=&#39;+encodeURIComponent(u)+&#39;&amp;amp;t=&#39;+encodeURIComponent(t),&#39;sharer&#39;,&#39;toolbar=0,status=0,width=626,height=436&#39;);return false;}&amp;lt;/script&amp;gt;&amp;lt;a rel=&quot;nofollow&quot; href=&quot;http://www.facebook.com/share.php?u=&amp;lt;;url&amp;gt;&quot; onclick=&quot;return fbs_click()&quot; target=&quot;_blank&quot;&amp;gt;Share on Facebook&amp;lt;/a&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Small icon and text:&lt;br/&gt;&lt;br/&gt;&amp;lt;script&amp;gt;function fbs_click() {u=location.href;t=document.title;window.open(&#39;http://www.facebook.com/sharer.php?u=&#39;+encodeURIComponent(u)+&#39;&amp;amp;t=&#39;+encodeURIComponent(t),&#39;sharer&#39;,&#39;toolbar=0,status=0,width=626,height=436&#39;);return false;}&amp;lt;/script&amp;gt;&amp;lt;style&amp;gt; html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }&amp;lt;/style&amp;gt;&amp;lt;a rel=&quot;nofollow&quot; href=&quot;http://www.facebook.com/share.php?u=&amp;lt;;url&amp;gt;&quot; onclick=&quot;return fbs_click()&quot; target=&quot;_blank&quot; class=&quot;fb_share_link&quot;&amp;gt;Share on Facebook&amp;lt;/a&amp;gt;&lt;br/&gt;&lt;br/&gt;Icon only:&lt;br/&gt;&lt;br/&gt;&amp;lt;script&amp;gt;function fbs_click() {u=location.href;t=document.title;window.open(&#39;http://www.facebook.com/sharer.php?u=&#39;+encodeURIComponent(u)+&#39;&amp;amp;t=&#39;+encodeURIComponent(t),&#39;sharer&#39;,&#39;toolbar=0,status=0,width=626,height=436&#39;);return false;}&amp;lt;/script&amp;gt;&amp;lt;style&amp;gt; html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; } &amp;lt;/style&amp;gt; &amp;lt;a rel=&quot;nofollow&quot; href=&quot;http://www.facebook.com/share.php?u=&amp;lt;;url&amp;gt;&quot; onclick=&quot;return fbs_click()&quot; target=&quot;_blank&quot; style=&quot;text-decoration:none;&quot;&amp;gt;Share&amp;lt;/a&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/930407559497332809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/930407559497332809?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/930407559497332809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/930407559497332809'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/06/add-on-facebook-button-to-webpage.html' title='Add a &amp;quot;Share on Facebook&amp;quot; button to a webpage.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2441019619063366241</id><published>2011-06-07T05:31:00.000-07:00</published><updated>2011-10-06T07:00:37.656-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP oAuth: update status"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP update status"/><category scheme="http://www.blogger.com/atom/ns#" term="Twitter"/><category scheme="http://www.blogger.com/atom/ns#" term="Twitter update status"/><title type='text'>Twitter, PHP oAuth: update status</title><content type='html'>Recently Twitter announced they are going disable basic authentication mechanism. Basic auth can be used until June 30th 2010, so there is only less then one month left (assuming you are reading this on June 2010). I admit that for a long time i neglected the OAuth Twitter authorization, it seemed complicated and time consuming in comparison basic auth.&lt;br/&gt;&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;However, when i found out they are shutting down the basic api, i had no other choice then to learn how it works. What it turned out is that with the right tools it’s pretty easy to do. Especially if you are (like me) looking to setup application that will be using only single user. For example to automatically update your status.&lt;br/&gt;&lt;h5&gt;The setup&lt;/h5&gt;&lt;br/&gt;With basic authorization all we needed was Twitter login and password, with OAuth it’s more complicated but a lot more secure at the same time, even if your app will be hacked your Twitter credentials are still safe.&lt;br/&gt;&lt;br/&gt;Ok let’s get started with it:&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;Go to dev.twitter.com sign in with your Twitter credentials, next click “&lt;a href=&quot;http://dev.twitter.com/apps/new&quot;&gt;Register an application&lt;/a&gt;” link&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Fill the form, it’s automatically accepted so Twitter guys probably don’t check it all, but still … keep it proffesional. One important thing here is to select “Read and Write” on “Default Access type”. Click “Register Application” and you’re done&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Now you will need 4 keys to make your app work. Go to “&lt;a href=&quot;http://dev.twitter.com/apps&quot;&gt;View Your Applications&lt;/a&gt;” and then click “Edit details” on your newly created app. Scroll down and copy (somewhere) “Consumer Key” and “Consumer Secret”&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Next in the right sidebar click link “My access token” and copy both: “Access Token (oauth_token)” and “Access Token Secret (oauth_token_secret)”&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;a href=&quot;http://github.com/abraham/twitteroauth/zipball/0.2.0-beta3&quot;&gt;Abraham Twitter OAuth library&lt;/a&gt;(click the link to download the zip file of app). There few files in the archive, but we will need only two: twitteroauth/twitteroauth.php and twitteroauth/OAuth.php.&lt;br/&gt;&lt;h5&gt;Twitter and PHP OAuth integration&lt;/h5&gt;&lt;br/&gt;Now let’s get straight to the actual code. The good news it’s there almost nothing to do: just include TwitterOAuth library, put keys and tokens you copied earlier into the script and you are done.&lt;br/&gt;&lt;pre&gt;&amp;lt;?php&lt;br/&gt;require_once &#39;TwitterOAuth.php&#39;;&lt;br/&gt;&lt;br/&gt;define(&quot;CONSUMER_KEY&quot;, &quot;XXXX&quot;);&lt;br/&gt;define(&quot;CONSUMER_SECRET&quot;, &quot;XXXX&quot;);&lt;br/&gt;define(&quot;OAUTH_TOKEN&quot;, &quot;XXXX&quot;);&lt;br/&gt;define(&quot;OAUTH_SECRET&quot;, &quot;XXXX&quot;);&lt;br/&gt;&lt;br/&gt;$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);&lt;br/&gt;$content = $connection-&amp;gt;get(&#39;account/verify_credentials&#39;);&lt;br/&gt;&lt;br/&gt;$connection-&amp;gt;post(&#39;statuses/update&#39;, array(&#39;status&#39; =&amp;gt; &#39;Test status message&#39;));&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2441019619063366241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2441019619063366241?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2441019619063366241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2441019619063366241'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/06/twitter-php-oauth-update-status.html' title='Twitter, PHP oAuth: update status'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-8545693671554419746</id><published>2011-05-31T00:20:00.000-07:00</published><updated>2011-10-06T07:00:37.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clear facebook cache"/><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook cache"/><title type='text'>How to clear Facebook Share’s Cache</title><content type='html'>&lt;div&gt;&lt;br/&gt;&lt;br/&gt;Facebook share is good, simple, lets us share almost everything on web in seconds. But Facebook caches already shared urls/pages for better performance. This causes issues at time when we update the title, picture being shared or the description of the page because facebook still shows the older version of the page.&lt;br/&gt;&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;I will discuss three simple ways to force facebook to go and fetch the latest stuff from the page being shared.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Method 1 :&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Facebook treats each url as unique and caches the page based on that url, so if you want to share the latest url the simplest solution is to add a query string with the url being shared. In simple words just add &lt;strong&gt;?v=1&lt;/strong&gt; at the end of the url. Any number can be used in place of 1,&lt;br/&gt;&lt;br/&gt;This method is fairly simple but it doesn’t retain the share count for this page, as it treats this page as a different url hence the count for this url will be restarted from 0. Plus if someone else shares the original url without the querystring the information will still be the old one.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Using url shortner services like &lt;a title=&quot;bit.ly&quot; href=&quot;http://bit.ly/&quot; target=&quot;_blank&quot;&gt;bit.ly&lt;/a&gt;. shorten your url form bit.ly and then use the new url for facebook share. This too is a simple and quite popular method but has the same issues as the first one.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Method 3:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Facebook has a tool called URL Linter. This tool gives us an idea about how a url will be shared on facebook, what content, which image will be fetched.&lt;br/&gt;&lt;br/&gt;We can use this tool for any url and it fetches the latest title, description, excerpt and other stuff that will be shown while sharing the link. If you use an already shared URL with this tool then facebook fetches the latest content, and also updates it cache with the latest content.&lt;br/&gt;&lt;br/&gt;With this methos the url remains the same hence the share count will persist only the content will be updated. Someone else sharing the url will also see the latest content now. So this method is the ofcourse the best.&lt;br/&gt;&lt;br/&gt;The url linter tool can be accessed on &lt;strong&gt;&lt;a title=&quot;Facbook URL Linter&quot; href=&quot;http://developers.facebook.com/tools/lint/&quot; target=&quot;_blank&quot;&gt;Facebook URL Linter&lt;/a&gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/8545693671554419746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/8545693671554419746?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8545693671554419746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/8545693671554419746'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/05/how-to-clear-facebook-shares-cache.html' title='How to clear Facebook Share’s Cache'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2068113526099930370</id><published>2011-05-31T00:16:00.000-07:00</published><updated>2011-10-06T07:00:37.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="query sting in javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="query string"/><title type='text'>Get URL Parameters Using Javascript</title><content type='html'>&lt;blockquote&gt;&amp;lt;script&amp;gt;&lt;br/&gt;function getQueryVariable(variable) {&lt;br/&gt;var query = window.location.search.substring(1);&lt;br/&gt;var vars = query.split(&quot;&amp;amp;&quot;);&lt;br/&gt;for (var i=0;i&amp;lt;vars.length;i++) {&lt;br/&gt;var pair = vars[i].split(&quot;=&quot;);&lt;br/&gt;if (pair[0] == variable) {&lt;br/&gt;return pair[1];&lt;br/&gt;}&lt;br/&gt;}&lt;br/&gt;alert(&#39;Query Variable &#39; + variable + &#39; not found&#39;);&lt;br/&gt;}&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&lt;br/&gt;Now make a request to page.html?x=Hello&lt;br/&gt;&lt;br/&gt;&amp;lt;script&amp;gt;&lt;br/&gt;alert( getQueryVariable(&quot;x&quot;) );&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2068113526099930370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2068113526099930370?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2068113526099930370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2068113526099930370'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/05/get-url-parameters-using-javascript.html' title='Get URL Parameters Using Javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-5271187700934772604</id><published>2011-05-18T12:01:00.000-07:00</published><updated>2011-10-06T07:00:37.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery validation"/><category scheme="http://www.blogger.com/atom/ns#" term="Jquery validation with custom error message"/><category scheme="http://www.blogger.com/atom/ns#" term="Jquery validation with custom message"/><title type='text'>Jquery Validation with custom message</title><content type='html'>&lt;strong&gt;You can validate the HTML form using the Jquery with your custom error message.&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;This is very easy to implement and require little knowledge of jquery.&lt;br/&gt;&lt;br/&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;The sample code for the jquery validation are:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Copy this part in your head section.&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://view.jquery.com/trunk/plugins/validate/jquery.validate.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;br/&gt;* { font-family: Verdana; font-size: 96%; }&lt;br/&gt;label { width: 10em; float: left; }&lt;br/&gt;label.error { float: none; color: red; margin-left:20px; vertical-align: top; display:block;}&lt;br/&gt;p { clear: both; }&lt;br/&gt;.submit { margin-left: 12em; }&lt;br/&gt;em { font-weight: bold; padding-right: 1em; vertical-align: top; }&lt;br/&gt;&amp;lt;/style&amp;gt;&lt;br/&gt;&amp;lt;script&amp;gt;&lt;br/&gt;$(document).ready(function(){&lt;br/&gt;$(&quot;#commentForm&quot;).validate({&lt;br/&gt;rules: {&lt;br/&gt;name: &quot;required&quot;,&lt;br/&gt;email: {&lt;br/&gt;required:true,&lt;br/&gt;email:true&lt;br/&gt;},&lt;br/&gt;url:{required:true,url:true},&lt;br/&gt;comment:&quot;required&quot;&lt;br/&gt;},&lt;br/&gt;messages: {&lt;br/&gt;email: {&lt;br/&gt;required: &#39;Enter this!&#39;,&lt;br/&gt;email: &#39;enter valid email&#39;&lt;br/&gt;},&lt;br/&gt;name: {&lt;br/&gt;required: &#39;Enter name!&#39;&lt;br/&gt;},&lt;br/&gt;url: {&lt;br/&gt;required: &#39;Enter URL!&#39;,&lt;br/&gt;url: &#39;Valid url&#39;&lt;br/&gt;},&lt;br/&gt;comment: {&lt;br/&gt;required: &#39;Enter Comment!&#39;&lt;br/&gt;}&lt;br/&gt;}&lt;br/&gt;});&lt;br/&gt;});&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Copy this part in your body section.&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;form id=&quot;commentForm&quot; method=&quot;get&quot; action=&quot;&quot;&amp;gt;&lt;br/&gt;&amp;lt;fieldset&amp;gt;&lt;br/&gt;&amp;lt;legend&amp;gt;A simple comment form with submit validation and default messages&amp;lt;/legend&amp;gt;&lt;br/&gt;&amp;lt;table&amp;gt;&lt;br/&gt;&amp;lt;tr&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;label for=&quot;cname&quot;&amp;gt;Name&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;em&amp;gt;*&amp;lt;/em&amp;gt;&amp;lt;input id=&quot;cname&quot; name=&quot;name&quot; size=&quot;25&quot;  minlength=&quot;2&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;/tr&amp;gt;&lt;br/&gt;&amp;lt;tr&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;label for=&quot;cemail&quot;&amp;gt;E-Mail&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;em&amp;gt;*&amp;lt;/em&amp;gt;&amp;lt;input id=&quot;cemail&quot; name=&quot;email&quot; size=&quot;25&quot;   /&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;/tr&amp;gt;&lt;br/&gt;&amp;lt;tr&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;label for=&quot;curl&quot;&amp;gt;URL&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;em&amp;gt;*&amp;lt;/em&amp;gt;&amp;lt;input id=&quot;curl&quot; name=&quot;url&quot; size=&quot;25&quot;  value=&quot;&quot; /&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;/tr&amp;gt;&lt;br/&gt;&amp;lt;tr&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;label for=&quot;ccomment&quot;&amp;gt;Your comment&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;td&amp;gt;&amp;lt;em&amp;gt;*&amp;lt;/em&amp;gt;&amp;lt;textarea id=&quot;ccomment&quot; name=&quot;comment&quot; cols=&quot;22&quot;&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;/tr&amp;gt;&lt;br/&gt;&amp;lt;tr&amp;gt;&lt;br/&gt;&amp;lt;td colspan=&quot;2&quot;&amp;gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Submit&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt;&amp;lt;/tr&amp;gt;&lt;br/&gt;&amp;lt;/table&amp;gt;&lt;br/&gt;&amp;lt;/fieldset&amp;gt;&lt;br/&gt;&amp;lt;/form&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/5271187700934772604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/5271187700934772604?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5271187700934772604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5271187700934772604'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/05/jquery-validation-with-custom-message.html' title='Jquery Validation with custom message'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-5323748905241500015</id><published>2011-03-07T12:02:00.001-08:00</published><updated>2011-03-07T12:02:33.040-08:00</updated><title type='text'>How to make bootable pen drive</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;br /&gt;
*USB Flash Drive (Minimum 4GB)&lt;br /&gt;
*Windows 7 or Vista installation files.&lt;br /&gt;
Follow the below steps to create bootable Windows 7/Vista USB drive using which you can install Windows 7/Vista easily.&lt;br /&gt;
&lt;strong&gt;1&lt;/strong&gt;. Plug-in your USB flash drive to USB port and move all the contents from USB drive to a safe location on your system.&lt;br /&gt;
&lt;strong&gt;2&lt;/strong&gt;. Open Command &lt;a class=&quot;kLink&quot; href=&quot;http://www.blogger.com/post-create.g?blogID=9176502964716205586#&quot; id=&quot;KonaLink0&quot; jquery1299527398275=&quot;9&quot; style=&quot;position: static; text-decoration: underline !important;&quot;&gt;&lt;span style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: relative;&quot;&gt;Prompt&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; with admin rights. Use any of the below methods to open Command Prompt with admin rights.&lt;br /&gt;
*Type&lt;strong&gt; cmd&lt;/strong&gt; in &lt;a class=&quot;kLink&quot; href=&quot;http://www.blogger.com/post-create.g?blogID=9176502964716205586#&quot; id=&quot;KonaLink1&quot; jquery1299527398275=&quot;8&quot; style=&quot;position: static; text-decoration: underline !important;&quot;&gt;&lt;span style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: relative;&quot;&gt;Start&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; menu search box and hit&lt;strong&gt; Ctrl&lt;/strong&gt;+ &lt;strong&gt;Shift&lt;/strong&gt;+ &lt;strong&gt;Enter&lt;/strong&gt;.&lt;br /&gt;
Or&lt;br /&gt;
*Go to Start menu &amp;gt; All programs &amp;gt; Accessories, right click on Command Prompt and select Run as administrator.&lt;br /&gt;
&lt;strong&gt;3&lt;/strong&gt;. You need to know about the USB drive a little bit. Type in the following commands in the command prompt:&lt;br /&gt;
First type &lt;strong&gt;DISKPART&lt;/strong&gt; and hit enter to see the below message.&lt;br /&gt;
&lt;a href=&quot;http://www.flickr.com/photos/30447518@N04/3188204502/&quot;&gt;&lt;img alt=&quot;Bootable USB Drive&quot; border=&quot;0&quot; height=&quot;142&quot; src=&quot;http://www.intowindows.com/wp-content/uploads/2009/01/12.jpg&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;Bootable USB Drive&quot; width=&quot;523&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Next type &lt;strong&gt;LIST DISK&lt;/strong&gt; command and note down the Disk number (ex: Disk 1) of your USB flash drive. In the below screenshot my Flash Drive Disk no is &lt;strong&gt;Disk 1&lt;/strong&gt;.&lt;br /&gt;
&lt;strong&gt;4&lt;/strong&gt;. Next type all the below commands one by one. Here I assume that your disk drive no is “&lt;strong&gt;Disk 1&lt;/strong&gt;”.If you have Disk 2 as your USB flash drive then use Disk 2.Refer the above step to confirm it.&lt;br /&gt;
So below are the commands you need to type and execute one by one:&lt;br /&gt;
&lt;strong&gt;SELECT DISK 1 &lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;CLEAN&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;CREATE PARTITION PRIMARY&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;SELECT PARTITION 1&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;ACTIVE&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;FORMAT FS=NTFS&lt;/strong&gt;&lt;br /&gt;
(Format process may take few seconds)&lt;br /&gt;
&lt;strong&gt;ASSIGN&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;EXIT&lt;/strong&gt;&lt;br /&gt;
Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.&lt;br /&gt;
&lt;a href=&quot;http://www.flickr.com/photos/30447518@N04/3188216154/&quot;&gt;&lt;img alt=&quot;Bootable USB Drive&quot; border=&quot;0&quot; height=&quot;452&quot; src=&quot;http://www.intowindows.com/wp-content/uploads/2009/01/115.jpg&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;Bootable USB Drive&quot; width=&quot;437&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;5&lt;/strong&gt;. Next insert your Windows7/Vista DVD into the optical drive and check the drive letter of the DVD drive. In this guide I will assume that your DVD drive letter is “D” and USB drive letter is “H” (open my computer to know about it).&lt;br /&gt;
&lt;strong&gt;6&lt;/strong&gt;. Maximize the minimized Command Prompt in the 4th step.Type&amp;nbsp; the following command now:&lt;br /&gt;
&lt;strong&gt;D: CD BOOT&lt;/strong&gt; and hit enter.Where “D” is your DVD drive letter.&lt;br /&gt;
&lt;strong&gt;CD BOOT&lt;/strong&gt; and hit enter to see the below message.&lt;br /&gt;
&lt;strong&gt;7&lt;/strong&gt;. Type another command given below to update the USB drive with BOOTMGR compatible code.&lt;br /&gt;
&lt;strong&gt;BOOTSECT.EXE /NT60 H&lt;/strong&gt;:&lt;br /&gt;
&lt;a href=&quot;http://www.flickr.com/photos/30447518@N04/3188222246/&quot;&gt;&lt;img alt=&quot;14&quot; border=&quot;0&quot; height=&quot;220&quot; src=&quot;http://www.intowindows.com/wp-content/uploads/2009/01/14.jpg&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;14&quot; width=&quot;533&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Where “H” is your USB drive letter. Once you enter the above command you will see the below message.&lt;br /&gt;
&lt;strong&gt;8&lt;/strong&gt;. Copy your Windows 7/Vista DVD contents to the USB flash drive.&lt;br /&gt;
&lt;strong&gt;9&lt;/strong&gt;. Your USB drive is ready to boot and install Windows 7/Vista. Only thing you need to change the boot priority at the BIOS to USB from the HDD or &lt;a class=&quot;kLink&quot; href=&quot;http://www.blogger.com/post-create.g?blogID=9176502964716205586#&quot; id=&quot;KonaLink2&quot; jquery1299527398275=&quot;7&quot; style=&quot;position: static; text-decoration: underline !important;&quot;&gt;&lt;span style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: relative;&quot;&gt;CD &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: relative;&quot;&gt;ROM &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: #00aef0 !important; font-family: Verdana; font-size: 13px; font-weight: 400; position: relative;&quot;&gt;drive&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. I won’t explain it as it’s just the matter the changing the boot priority or enabling the USB boot option in the BIOS.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/5323748905241500015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/5323748905241500015?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5323748905241500015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/5323748905241500015'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/03/how-to-make-bootable-pen-drive.html' title='How to make bootable pen drive'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9176502964716205586.post-2028200361079027104</id><published>2011-03-07T11:59:00.001-08:00</published><updated>2011-03-07T11:59:32.568-08:00</updated><title type='text'>How to make a custom &quot;404 error&quot; page!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;A &quot;404&quot; is an error message you get when you follow a link to a web-page that doesn&#39;t exist. By default this error message is a web-page created by your web-host provider. &lt;br /&gt;
Did you know that you can customize this web-page? This will keep you from losing viewers when you delete a page or mess up a link ... funneling those &quot;lost souls&quot; back into your site. This is especially important for search engines ... you don&#39;t want to lose all that SE traffic when you move a page! &lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: medium;&quot;&gt;Directions&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open a text editor (Windows notepad will do), and copy the following onto the first line: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ErrorDocument 404 /error-page.html &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now, save the file onto your hard-drive as a text file (.txt) and name it &quot;&lt;b&gt;.htaccess.txt&lt;/b&gt;&quot;. Yes, I know that is a weird file name, but that first period is necessary. We&#39;ll rename the file after we upload it. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;FTP to your web-site&#39;s root directory (where your homepage is located) with a program like WS-FTP. Copy the above file into the main directory of your site. &lt;br /&gt;
&lt;span style=&quot;color: #cc0000; font-size: x-small;&quot;&gt;note: Be sure to upload in &quot;ascii&quot; and not &quot;binary&quot; format.&lt;/span&gt; &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Rename &quot;&lt;b&gt;.htaccess.txt&lt;/b&gt;&quot; to plain old &quot;&lt;b&gt;.htaccess&lt;/b&gt;&quot; &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Finally, create a custom web-page with your html editor, name it &quot;&lt;b&gt;error-page.html&lt;/b&gt;&quot;, and upload it into your root directory.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coding-hint.blogspot.com/feeds/2028200361079027104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9176502964716205586/2028200361079027104?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2028200361079027104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9176502964716205586/posts/default/2028200361079027104'/><link rel='alternate' type='text/html' href='http://coding-hint.blogspot.com/2011/03/how-to-make-custom-404-error-page.html' title='How to make a custom &quot;404 error&quot; page!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03184478645453261963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>