<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>sarwar&#039;s weblogs</title>
	<atom:link href="http://sarwarhossain.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sarwarhossain.com</link>
	<description>story of web applications.....</description>
	<lastBuildDate>Sat, 28 Jan 2012 16:47:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sarwarhossain.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/86873ed9c4eba27a2311cfa309d9a1bd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>sarwar&#039;s weblogs</title>
		<link>http://sarwarhossain.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sarwarhossain.com/osd.xml" title="sarwar&#039;s weblogs" />
	<atom:link rel='hub' href='http://sarwarhossain.com/?pushpress=hub'/>
		<item>
		<title>Remove Skype Plugin from browser using jQuery</title>
		<link>http://sarwarhossain.com/2012/01/23/remove-skype-plugin-from-browser-using-jquery/</link>
		<comments>http://sarwarhossain.com/2012/01/23/remove-skype-plugin-from-browser-using-jquery/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 09:57:37 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[skype number]]></category>

		<guid isPermaLink="false">http://sarwarhossain.com/?p=245</guid>
		<description><![CDATA[I got some problem after installing the skype plugins on my browser. This plugin always convert to a call now button to numbers, sometime some number is not a phone number, which cause problem for our web design. I found a solution which we can used for stop converting the call now button for numbers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=245&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got some problem after installing the skype plugins on my browser. This plugin always convert to a call now button to numbers, sometime some number is not a phone number, which cause problem for our web design. I found a solution which we can used for stop converting the call now button for numbers on the webpage.</p>
<p><pre class="brush: plain;">
&lt;script src=&quot;YOUR_JQUERY_PAT/jquery.min.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;javascript&quot;&gt;
	$(document).ready(function() {
		window.setTimeout(function() {
			$('.skype_pnh_container').html('');
			$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
		}, 700);
	});
&lt;/script&gt;
</pre></p>
<p>Its work for me. I found it form <a href="http://www.petefreitag.com/item/751.cfm" title="Here" target="_blank">here</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=245&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2012/01/23/remove-skype-plugin-from-browser-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>quick setup of Auth Component for CakePHP 2.0</title>
		<link>http://sarwarhossain.com/2012/01/15/simple-uses-of-auth-component-for-cakephp-2/</link>
		<comments>http://sarwarhossain.com/2012/01/15/simple-uses-of-auth-component-for-cakephp-2/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 19:52:49 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Auth]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[Login]]></category>

		<guid isPermaLink="false">http://sarwarhossain.com/?p=237</guid>
		<description><![CDATA[I found some new thing in cakephp 2.x.  I just tried to show here how quickly we can setup Auth Component in to our project. First we need to setup configuration Logic check controller. Login view here, this is login form When we create a user we need to setup the hash password field I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=237&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found some new thing in cakephp 2.x.  I just tried to show here how quickly we can setup Auth Component in to our project.</p>
<p>First we need to setup configuration<br />
<pre class="brush: plain;">
// app/Controller/AppController.php
var $components = array(
        &quot;Auth&quot; =&gt; array(
            'loginRedirect' =&gt; array('controller' =&gt; 'dashboard', 'action' =&gt; 'index'), // After success where page goes to 
            'logoutRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'login') // This is login page 
        ),
        &quot;Session&quot;);
function beforeFilter(){
.....
         $this-&gt;Auth-&gt;authenticate = array( 
                                        AuthComponent::ALL =&gt; array('userModel' =&gt; 'User', 'scope' =&gt; array(&quot;User.status&quot; =&gt; 1)),
                                        'Form');


}
</pre></p>
<p>Logic check controller.<br />
<pre class="brush: plain;">
//app/Controller/UsersController.php
    function login() 
    {
        if($this-&gt;request-&gt;is('post')){
        {
              if($this-&gt;Auth-&gt;login()){
                  $this-&gt;loginUser = AuthComponent::user();  // Here $this-&gt;loginUser is defined so we can get the user values here. 
                  return $this-&gt;redirect($this-&gt;Auth-&gt;redirect());
              }else{
                  $this-&gt;Session-&gt;setFlash('Username or password is incorrect', 'default', array(), 'auth');
              }
          }   
        
        }
    }
</pre></p>
<p>Login view here, this is login form<br />
<pre class="brush: plain;">
    echo $this-&gt;Session-&gt;flash('auth'); // This will show the authentication error message
    echo $this-&gt;Form-&gt;create('User', array(&quot;controller&quot; =&gt; &quot;users&quot;, &quot;action&quot; =&gt; &quot;login&quot;, &quot;method&quot; =&gt; &quot;post&quot;));

    echo $this-&gt;Form-&gt;input('User.username', array(&quot;label&quot; =&gt; &quot;Username:&quot;));
    echo $this-&gt;Form-&gt;input('User.password', array(&quot;label&quot; =&gt; &quot;Password: &quot;));
    echo $this-&gt;Form-&gt;end('Login');

</pre></p>
<p>When we create a user we need to setup the hash password field<br />
<pre class="brush: plain;">

If we need hash password, we need to do the follwoing 
[code]
//app/Model/User.php

function beforeSave(){
    if (isset($this-&gt;data[$this-&gt;alias]['password'])) {
            $this-&gt;data[$this-&gt;alias]['password'] = AuthComponent::password($this-&gt;data[$this-&gt;alias]['password']);
    }
}
</pre></p>
<p>I can add user normally and its work.</p>
<p>I just show here the basic login use which is used for quick setup.</p>
<p>Happy login <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><em>If you want to go more advanced uses of component go to <a href="http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html">Docs</a></em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=237&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2012/01/15/simple-uses-of-auth-component-for-cakephp-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple line html code assign to a javascript variable/ assign cakephp element to a javascript variable</title>
		<link>http://sarwarhossain.com/2011/08/05/multiple-line-html-code-assign-to-a-javascript-variable-assign-cakephp-element-to-a-javascript-variable/</link>
		<comments>http://sarwarhossain.com/2011/08/05/multiple-line-html-code-assign-to-a-javascript-variable-assign-cakephp-element-to-a-javascript-variable/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 07:02:49 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cakephp element]]></category>
		<category><![CDATA[js variable multiple line]]></category>
		<category><![CDATA[json_encode]]></category>

		<guid isPermaLink="false">http://sarwarhossain.com/?p=226</guid>
		<description><![CDATA[I was working with google map api, I have task to make a infowindow for a marker. I faced some problem when I assigned multiple line code to a javascript variable. I tried to put a html code to a javascrpt variable which will use for info window. I need to put block of html [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=226&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was working with google map api, I have task to make a infowindow for a marker. I faced some problem when I assigned multiple line code to a javascript variable. I tried to put a html code to a javascrpt variable which will use for info window. </p>
<p>I need to put block of html code (cakephp element) to a variable. if we do like the following<br />
<pre class="brush: plain;">
&lt;script&gt;
var infowindow = '&lt;div class=&quot;map_info_content&quot;&gt;
    &lt;table cellpadding=&quot;3&quot; cellspacing=&quot;3&quot;&gt;
        &lt;tr&gt;
            &lt;td colspan=&quot;2&quot;&gt;
                &lt;h1 class=&quot;map_title&quot;&gt;&lt;?=$map_title?&gt;&lt;/h1&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
                &lt;img src=&quot;&lt;?=$imgurl?&gt;&quot; style=&quot;&lt;?=$style_img?&gt;&quot; /&gt; 
            &lt;/td&gt;
            &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
                &lt;p&gt;
                    &lt;?=$msg?&gt;
                &lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;';
&lt;/script&gt;
</pre><br />
Its not not working, we need to put a slash / each end of line or need to write infowindow += &#8220;&#8221; for each line.<br />
Now If we keep that html code to a cakephp element and just call the element and make it json_encode it work or keep this in to a php variable and make it json encode it working lets see<br />
<pre class="brush: plain;">
&lt;?php
    $html = '&lt;div class=&quot;map_info_content&quot;&gt;
    &lt;table cellpadding=&quot;3&quot; cellspacing=&quot;3&quot;&gt;
        &lt;tr&gt;
            &lt;td colspan=&quot;2&quot;&gt;
                &lt;h1 class=&quot;map_title&quot;&gt;Title&lt;/h1&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
                &lt;img src=&quot;info.jpg&quot; style=&quot;&quot; /&gt; 
            &lt;/td&gt;
            &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
                &lt;p&gt;
                    HERE IS YOUR MSG
                &lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;';
// Now make it json encode
$html = json_encode($html);
?&gt;
// Now Assign it to a javascript variable
&lt;script&gt;
 var infowindow = &lt;?=$html?&gt; 
// OR if cakephp element
 var infowindow = &lt;?=json_encode($this-&gt;element(&quot;infowindow&quot;))?&gt;

&lt;/script&gt;
</pre></p>
<p><strong>json_encode</strong> is very useful method to working like this.<br />
 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=226&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/08/05/multiple-line-html-code-assign-to-a-javascript-variable-assign-cakephp-element-to-a-javascript-variable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>jquery UI tab &#8211; ajax loading CKEDITOR in a tab and some issues</title>
		<link>http://sarwarhossain.com/2011/07/28/jquery-ui-tab-ajax-loading-ckeditor-in-a-tab-and-some-issues/</link>
		<comments>http://sarwarhossain.com/2011/07/28/jquery-ui-tab-ajax-loading-ckeditor-in-a-tab-and-some-issues/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 07:36:19 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Jquery UI]]></category>

		<guid isPermaLink="false">http://sarwarhossain.com/?p=221</guid>
		<description><![CDATA[I tried to load CKEDITOR in a jquery tab via ajax. I got problem that only first time the ckeditor is working but when I click on other tab and again got o ckeditor tab its not working. in Load section for tab I put the following code. in this way we can get rid [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=221&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to load CKEDITOR in a jquery tab via ajax. I got problem that only first time the ckeditor is working but when I click on other tab and again got o ckeditor tab its not working. in Load section for tab I put the following code.<br />
<pre class="brush: plain;">
load: function(event, ui) {
  if(ui.index == 3){ // Checked tab no 4
    var instance = CKEDITOR.instances['reditor']; // reditor is text area id, check if instances exists for readitor or not 
    if(instance){ 
       CKEDITOR.remove(instance); //if existed then remove it
    }
    CKEDITOR.replace( 'reditor' ); // Create instance for 'reditor'
 }
}
</pre><br />
in this way we can get rid the problem of &#8220;CKEditor instance already exists&#8221;</p>
<p><b>Here is whole configuration</b><br />
<pre class="brush: plain;">
$(document).ready(function () {
           var $tabs = $(&quot;#tabs&quot;).tabs({ 
                                
                                alignment: &quot;top&quot;,
                                spinner : false,
                                ajaxOptions: {
                                    error: function( xhr, status, index, anchor ) {
                                                    $( anchor.hash ).html( &quot;Couldn't load this tab. Please try again.&quot;);
                                                },
                                    complete: function(){
                                        
                                        
                                    }
                                    
                                },
                                load: function(event, ui) {
                                    if(ui.index == 3){
                                        var instance = CKEDITOR.instances['reditor'];
                                        if(instance){
                                            CKEDITOR.remove(instance);
                                        }
                                    }
                                },
                                select: function(e, ui){
                                            $(ui.panel).html('&lt;img src=&quot;img/ajax_loader.gif&quot; /&gt;'); // Loader after click on each tab
                                        }
                                
                                });
           $tabs.tabs('select', &lt;?=$tab_no?&gt;); // used for selected default tab
           
        });
        
</pre></p>
<p>Here is HTML/PHP (I used cakephp syntax for url ) used &#8220;<span>TEXT</span>&#8221; in a link to show the loading text on tab otherwise it will not show the loading tabl<br />
<pre class="brush: plain;">
&lt;div id=&quot;tabs&quot;&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;?=$html-&gt;link(&quot;&lt;span&gt;Information&lt;/span&gt;&quot;, array(&quot;controller&quot; =&gt; &quot;listings&quot;, &quot;action&quot; =&gt; &quot;information&quot;, $id), array(&quot;escape&quot; =&gt; false, &quot;title&quot; =&gt; &quot;Information&quot;))?&gt;
            
        &lt;/li&gt;
        &lt;li&gt;
            &lt;?=$html-&gt;link(&quot;&lt;span&gt;Detail&lt;/span&gt;&quot;, array(&quot;controller&quot; =&gt; &quot;listings&quot;, &quot;action&quot; =&gt; &quot;detail&quot;, $id), array(&quot;escape&quot; =&gt; false))?&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;?=$html-&gt;link(&quot;&lt;span&gt;Peoples&lt;/span&gt;&quot;, array(&quot;controller&quot; =&gt; &quot;listing&quot;, &quot;action&quot; =&gt; &quot;peoples&quot;, $id), array(&quot;escape&quot; =&gt; false))?&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;?=$html-&gt;link(&quot;&lt;span&gt;Enhance&lt;/span&gt;&quot;, array(&quot;controller&quot; =&gt; &quot;listings&quot;, &quot;action&quot; =&gt; &quot;enhance&quot;, $id), array(&quot;escape&quot; =&gt; false))?&gt;
       &lt;/li&gt;
    &lt;/ul&gt;
 &lt;/div&gt;
</pre></p>
<p>In this way I did and it work for me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=221&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/07/28/jquery-ui-tab-ajax-loading-ckeditor-in-a-tab-and-some-issues/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>cakephp- CONCAT in query, Virtual Fields and make a drop down</title>
		<link>http://sarwarhossain.com/2011/06/18/cakephp-concat-in-query-virtual-fields-and-make-a-drop-down/</link>
		<comments>http://sarwarhossain.com/2011/06/18/cakephp-concat-in-query-virtual-fields-and-make-a-drop-down/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 10:35:45 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CONCAT]]></category>
		<category><![CDATA[virtual fields]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=206</guid>
		<description><![CDATA[I need to make a dropdown list of a staff. In dorpdown i need to put last name and first name. I already have a column in database name which contain first name and last name. But i need to show order last name then first name. I tied to put CONCAT in query its [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=206&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I need to make a dropdown list of a staff. In dorpdown i need to put last name and first name. I already have a column in database name which contain first name and last name. But i need to show order last name then first name. </p>
<p>I tied to put CONCAT in query its working but the array result not showing properly. In this case I found that if i put a virtual fields in model that help me to fetch proper data. </p>
<p>In model<br />
<pre class="brush: plain;">
   var $virtualFields = array('dropdown_name' =&gt; 'CONCAT(Staff.last_name, &quot; &quot;, Staff.first_name)');
</pre></p>
<p>In controller query:<br />
<pre class="brush: plain;">
// Generate list
 $staff_list =  $this-&gt;Staff-&gt;find(&quot;list&quot;, array(
                                                        &quot;fields&quot; =&gt; array(&quot;id&quot;, &quot;dropdown_name&quot;),
                                                        &quot;order&quot; =&gt; array(&quot;Staff.name ASC&quot;),
                                                        &quot;conditions&quot; =&gt; array('Staff.status' =&gt; '1')
                                                        ));

</pre><br />
The above code give me the proper list of staff.<br />
In view to generate dropdown<br />
<pre class="brush: plain;">
    echo $form-&gt;input(&quot;Reports.staff_id&quot;, 
                                array(
                                    'options' =&gt; $staff_list, 
                                    'empty' =&gt; '--Please Select--' ,
                                    'label'=&gt; false, 
                                    ));    
</pre></p>
<p>In this way we can generate dropdown with different column in a one field. </p>
<p>The following I tried<br />
<pre class="brush: plain;">
          $staff_list = $this-&gt;Staff-&gt;find(&quot;list&quot;, array(
                                                        &quot;fields&quot; =&gt; array(&quot;Staff.id&quot;, &quot;CONCAT(`Staff`.`last_name`, ' ', `Staff`.`first_name`)&quot;),
                                                        &quot;order&quot; =&gt; array(&quot;AgencyStaff.name ASC&quot;),
                                                        &quot;conditions&quot; =&gt; array('Staff.status' =&gt; '1')
                                                        ));
</pre></p>
<p>The query is runing properly but the result array doesn&#8217;t keep the CONACT fields, it only keep the id balnk.</p>
<p>But I run the query in cakephp and check what actually give it the result .<br />
<pre class="brush: plain;">
$list = $this-&gt;Staff-&gt;query(&quot;SELECT `Staff`.`id` , CONCAT( `Staff`.`last_name` , ' ', `Staff`.`first_name` ) 
                                        FROM `staffs` AS `Staff`
                                            WHERE `Staff`.`status` =1
                                            ORDER BY `Staff`.`name` ASC&quot;);

</pre><br />
Result is the following<br />
<pre class="brush: plain;">
Array
(
    [0] =&gt; Array
        (
            [Staff] =&gt; Array
                (
                    [id] =&gt; 5
                )

            [0] =&gt; Array
                (
                    [CONCAT( `Staff`.`last_name` , ' ', `Staff`.`first_name` )] =&gt; Johnson Ashley
                )

        )
................
................
</pre></p>
<p>Thats why cakephp couldn&#8217;t make the proper array if we use their ORM.</p>
<p>I tried to use CONCAT( `Staff`.`last_name` , &#8216; &#8216;, `Staff`.`first_name` ) as `Staff`.`name`<br />
but it still not working.</p>
<p>SO I choose the virtual fields concept and it working properly for me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=206&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/06/18/cakephp-concat-in-query-virtual-fields-and-make-a-drop-down/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>trace visitor location based on their geolocation- how to</title>
		<link>http://sarwarhossain.com/2011/06/07/trace-visitor-location-based-on-their-geolocation-how-to/</link>
		<comments>http://sarwarhossain.com/2011/06/07/trace-visitor-location-based-on-their-geolocation-how-to/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 06:54:58 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[block ip]]></category>
		<category><![CDATA[find country]]></category>
		<category><![CDATA[geo location]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=198</guid>
		<description><![CDATA[I tried to find out a solution how we can block or trace visitor location and based on that location we do some action First you have to use 3rd party api to get visitor location. The following url will give you the detail. http://ipinfodb.com/ip_location_api.php Lets assume the visitor ip is 180.234.12.237 (you&#8217;ll get key [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=198&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to find out a solution how we can block or trace visitor location and based on that location we do some action</p>
<p>First you have to use 3rd party api to get visitor location. The following url will give you the detail.<br />
<a href="http://ipinfodb.com/ip_location_api.php">http://ipinfodb.com/ip_location_api.php</a></p>
<p>Lets assume the visitor ip is 180.234.12.237 (you&#8217;ll get key from that website)</p>
<p>http://api.ipinfodb.com/v3/ip-city/?key=&#038;ip=180.234.12.237</p>
<p>Its has some response format that is xml, json, raw, just you have to pass a get variable &amp;format=json</p>
<p><pre class="brush: plain;">
  if (getenv(HTTP_X_FORWARDED_FOR)){
        $pipaddress = getenv(HTTP_X_FORWARDED_FOR);
        $ipaddress = getenv(REMOTE_ADDR);
        //echo &quot;Your Proxy IPaddress is : &quot;.$pipaddress. &quot;(via $ipaddress)&quot; ;
    } else {
        $ipaddress = getenv(REMOTE_ADDR);
        //echo &quot;Your IP address is : $ipaddress&quot;;
    }     

    

$_API = &quot;83838s88s4e0a65jhk80246d77d8s5s3988d9fb1asdkf000asd8fslasdlfasdf6s9sce&quot;;
$_URL = &quot;http://api.ipinfodb.com/v3/ip-country/?key=$_API&amp;ip=$ipaddress&amp;format=json&quot;;

$data = file_get_contents($_URL);

$data = json_decode($data);
if(isset($data-&gt;statusCode) &amp;&amp; $data-&gt;statusCode == &quot;OK&quot;){
    if(isset($data-&gt;countryCode) &amp;&amp; ($data-&gt;countryCode != &quot;USA&quot; )) || $data-&gt;countryCode != &quot;BD&quot;)){
        header(&quot;Location:http://www.yourdomain.com/geolocation.php&quot;);     
        exit;
    }
}
</pre></p>
<p>In this way we can find out the country, city, post code, time zone etc. we can block or trace visitors in our website. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=198&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/06/07/trace-visitor-location-based-on-their-geolocation-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>.htaccess killing 3 hours</title>
		<link>http://sarwarhossain.com/2011/05/17/htaccess-killing-3-hours/</link>
		<comments>http://sarwarhossain.com/2011/05/17/htaccess-killing-3-hours/#comments</comments>
		<pubDate>Mon, 16 May 2011 19:49:53 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=194</guid>
		<description><![CDATA[I&#8217;m working in cakephp for last two years, I developed and hosted many times, during hosting I got many problem all these are .htaccess related. Today I tried to host one of my project, I created a server on rackspace cloud and installing all features apache, mysql, phpmyadmin and configure everything, I installed sugarcrm there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=194&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working in cakephp for last two years, I developed and hosted many times, during hosting I got many problem all these are .htaccess related. </p>
<p>Today I tried to host one of my project, I created a server on rackspace cloud and installing all features apache, mysql, phpmyadmin and configure everything, I installed sugarcrm there and it worked, but when I tried to run my cakephp project, its always displaying &#8220;PAGE NOT FOUND&#8221;. the rewrite mdoule was on and i checked it working for others,</p>
<p>I checked apache error/access log, not clue found, doing some google no result, but I never give-up again trying to do some google got a <a href="http://drupal.org/node/134439" title="reference " target="_blank">reference</a> in drupal site and check my apache configuration. </p>
<p>Only one thing I left in apache configuration.<br />
<pre class="brush: plain;">
// Open the apache site available
sudo nano /etc/apache2/sites-available/default
</pre></p>
<p>The article says that for URL rewriting we need to make &#8220;AllowOverride none&#8221; to &#8220;AllowOverride All&#8221;</p>
<p>I open that file and changed it.<br />
<pre class="brush: plain;">
&lt;VirtualHost *:80&gt;
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        &lt;Directory /&gt;
                Options FollowSymLinks
                AllowOverride All 
        &lt;/Directory&gt;
        &lt;Directory /var/www/&gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All 
                Order allow,deny
                allow from all
        &lt;/Directory&gt;
...... 
......
...
</pre></p>
<p>Done, went to my site and its working properly, <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=194&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/05/17/htaccess-killing-3-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>Access session data in a model -cakephp</title>
		<link>http://sarwarhossain.com/2011/05/14/access-session-data-in-a-model-cakephp/</link>
		<comments>http://sarwarhossain.com/2011/05/14/access-session-data-in-a-model-cakephp/#comments</comments>
		<pubDate>Fri, 13 May 2011 20:05:41 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=189</guid>
		<description><![CDATA[Sometime we may need auth data for inserting in bforeSave method, i know it break the MCV rule but we sometime we need it for doing faster. I used it in beforeSave method in a module In this way we can use full session component data here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=189&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometime we may need auth data for inserting in bforeSave method, i know it break the MCV rule but we sometime we need it for doing faster.</p>
<p>I used it in beforeSave method in a module<br />
<pre class="brush: plain;">
function beforeSave(){
   App::import('Component', 'SessionComponent'); 
   $session = new SessionComponent(); 
   // say we just retrieve the auth data
   $auth = $session-&gt;read(&quot;Auth.user&quot;);
  // here i used to add row value
  $this-&gt;data['ModelName']['field_name'] = $auth['login_user_id'];
   
  return true;
}
</pre></p>
<p>In this way we can use full session component data here. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=189&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/05/14/access-session-data-in-a-model-cakephp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>cakephp ajax pagination using jquery</title>
		<link>http://sarwarhossain.com/2011/04/26/cakephp-ajax-pagination-using-jquery/</link>
		<comments>http://sarwarhossain.com/2011/04/26/cakephp-ajax-pagination-using-jquery/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 02:02:22 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ajax pagination cakephp]]></category>
		<category><![CDATA[paginator]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=187</guid>
		<description><![CDATA[I tried to use cakephp default ajax pagination, it seems not working with me. I tried with different way. The following code using for pagination. Now below that code I used the following java script code Here, I just fire an event on click under paginator div, once you click on a link under that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=187&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to use cakephp default ajax pagination, it seems not working with me. I tried with different way. </p>
<p>The following code using for pagination.<br />
<pre class="brush: plain;">
&lt;div class=&quot;paginator&quot;&gt;
        &lt;?php echo $paginator-&gt;first(' First ', null, null, array('class' =&gt; 'disabled')); ?&gt;
        &lt;?php echo $paginator-&gt;prev('Previous ', null, null, array('class' =&gt; 'disabled')); ?&gt;
        &lt;?php echo $paginator-&gt;numbers(); ?&gt;
       &lt;?php echo $paginator-&gt;next(' Next ', null, null, array('class' =&gt; 'disabled')); ?&gt;
        &lt;?php echo $paginator-&gt;last(' Last ', null, null, array('class' =&gt; 'disabled')); ?&gt;
&lt;/div&gt;   
</pre></p>
<p>Now below that code I used the following java script code<br />
<pre class="brush: plain;">
&lt;script&gt;
    $(document).ready(function(){
        $(&quot;.paginator a&quot;).click(function(){
            $(&quot;#updated_div_id&quot;).load(this.href);
            return false;
        })
    });
&lt;/script&gt;
</pre></p>
<p>Here, I just fire an event on click under paginator div, once you click on a link under that div, it fetch the url (this.herf) and calling page using ajax, You must prepared the controller for ajax based. </p>
<p>for example your controller calling &#8216;ajax_pages&#8217; action.<br />
<pre class="brush: plain;">
function ajax_pages(){
        $this-&gt;layout = 'ajax';
        $this-&gt;paginate = array(
                                'order' =&gt; array('Module.created_date' =&gt; 'desc'), 
                                'recursive' =&gt; -1,
                                &quot;limit&quot; =&gt; PAGINATION_LIMIT
                                );
        
        $conditions['Module.module_type'] = $module_type;
        $data = $this-&gt;paginate(&quot;Module&quot;, $conditions);
        $this-&gt;set(compact(&quot;data&quot;));  
}
</pre></p>
<p>Its work for me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=187&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/04/26/cakephp-ajax-pagination-using-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
		<item>
		<title>Extract Zip File Using PHP</title>
		<link>http://sarwarhossain.com/2011/03/24/extract-zip-file-using-php/</link>
		<comments>http://sarwarhossain.com/2011/03/24/extract-zip-file-using-php/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 16:08:26 +0000</pubDate>
		<dc:creator>Sarwar</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[unzip]]></category>
		<category><![CDATA[zip]]></category>
		<category><![CDATA[ziparchive]]></category>

		<guid isPermaLink="false">http://bdsarwar.wordpress.com/?p=180</guid>
		<description><![CDATA[Sometime we need to extract a file on the server, say you don&#8217;t have access to shell and you want to extract a zip file, just put this to a php file and upload and run Its very simple and available idea everywhere, i jut wrote for note Done!!!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=180&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometime we need to extract a file on the server, say you don&#8217;t have access to shell and you want to extract a zip file, just put this to a php file and upload and run</p>
<p><pre class="brush: plain;">
     $zipObj = new ZipArchive;
     $file = $zipObj-&gt;open(’zip_file_name.zip’);
     if ($file == TRUE) {
         $zipObj-&gt;extractTo('extract_directory/');
         $zipObj-&gt;close();
         echo 'Unzip Successfully';
     } else {
         echo 'Failed to unzip';
     }
</pre></p>
<p>Its very simple and available idea everywhere, i jut wrote for note<br />
Done!!! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bdsarwar.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bdsarwar.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bdsarwar.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarwarhossain.com&amp;blog=4326278&amp;post=180&amp;subd=bdsarwar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarwarhossain.com/2011/03/24/extract-zip-file-using-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4058047cd7fb0f8e93f344ecb30c0d63?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Shuvo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
