<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>web7</title>
	
	<link>http://www.web7.co</link>
	<description>bits of web development</description>
	<lastBuildDate>Sat, 09 Jul 2011 08:48:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/web7blog" /><feedburner:info uri="web7blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>bits of web development</itunes:subtitle><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Photoshop brushes collection</title>
		<link>http://www.web7.co/photoshop-brushes-collection/</link>
		<comments>http://www.web7.co/photoshop-brushes-collection/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 08:22:58 +0000</pubDate>
		<dc:creator>webdevbit</dc:creator>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[brushes]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[photoshop brushes]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=387</guid>
		<description><![CDATA[Buddies, just realized to list out the sites providing good photoshop brushes. So here we go. Hope will be useful to you all. 1. myphotoshopbrushes &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 2. BrushKing &#160; &#160; &#160; &#160; &#160; &#160; &#160; 3. Brusheezy &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 4. [...]]]></description>
			<content:encoded><![CDATA[<p>Buddies, just realized to list out the sites providing good photoshop brushes. So here we go. Hope will be useful to you all.</p>
<p><strong><a title="myphotoshopbrushes" href="http://myphotoshopbrushes.com/" target="_blank">1. myphotoshopbrushes</a></strong></p>
<p><a href="http://myphotoshopbrushes.com/"><img class="alignleft" title="myphotoshopbrushes" src="http://myphotoshopbrushes.com/_images/brushes/normal/429.jpg" alt="myphotoshopbrushes | web7" width="300" height="300" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="brushking" href="http://www.brushking.eu/" target="_blank">2. BrushKing</a></strong></p>
<p><a href="http://www.brushking.eu/"><img class="alignleft size-medium wp-image-390" title="brushking" src="http://www.web7.co/wp-content/uploads/2011/07/brushking-300x212.png" alt="brushking" width="300" height="212" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="brusheezy" href="http://www.brusheezy.com/" target="_blank">3. Brusheezy</a></strong></p>
<p><a href="http://www.brusheezy.com"><img class="alignleft size-medium wp-image-391" title="brusheezy" src="http://www.web7.co/wp-content/uploads/2011/07/brusheezy-300x248.png" alt="brusheezy" width="300" height="248" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="psbrushes" href="http://www.psbrushes.net/" target="_blank">4. psbrushes</a></strong></p>
<p><a href="http://www.psbrushes.net/"><img class="alignleft size-medium wp-image-392" title="psbrushes" src="http://www.web7.co/wp-content/uploads/2011/07/psbrushes-300x248.png" alt="psbrushes" width="300" height="248" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="photoshopbrushes.eu" href="http://photoshopbrushes.eu/" target="_blank">5. photoshopbrushes.eu</a></strong></p>
<p><a href="http://photoshopbrushes.eu/"><img class="alignleft size-medium wp-image-393" title="photoshopbrushes-eu" src="http://www.web7.co/wp-content/uploads/2011/07/photoshopbrushes-eu-300x263.png" alt="photoshopbrushes-eu" width="300" height="263" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="photoshoproadmap" href="http://www.photoshoproadmap.com/Photoshop-downloads/Brushes/Most-recent/1/" target="_blank">6. Photoshoproadmap</a></strong></p>
<p><a href="http://www.photoshoproadmap.com/Photoshop-downloads/Brushes/Most-recent/1/"><img class="alignleft size-medium wp-image-394" title="photoshoproadmap" src="http://www.web7.co/wp-content/uploads/2011/07/photoshoproadmap-300x274.png" alt="photoshoproadmap" width="300" height="274" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="brushlovers" href="http://www.brushlovers.com/" target="_blank">7. Brushlovers</a></strong></p>
<p><a href="http://www.brushlovers.com/"><img class="alignleft size-medium wp-image-395" title="brushlovers" src="http://www.web7.co/wp-content/uploads/2011/07/brushlovers-300x254.png" alt="brushlovers" width="300" height="254" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="fbrushes" href="http://fbrushes.com/" target="_blank">8. fbrushes</a></strong></p>
<p><a href="http://fbrushes.com/"><img class="alignleft size-medium wp-image-396" title="fbrushes-com" src="http://www.web7.co/wp-content/uploads/2011/07/fbrushes-com-300x276.png" alt="fbrushes" width="300" height="276" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="qbrushes" href="http://qbrushes.net/" target="_blank">9. qbrushes</a></strong></p>
<p><a href="http://qbrushes.net/"><img class="alignleft size-medium wp-image-397" title="qbrushes-net" src="http://www.web7.co/wp-content/uploads/2011/07/qbrushes-net-300x273.png" alt="qbrushes" width="300" height="273" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><a title="brushdirectory" href="http://www.brushdirectory.com/" target="_blank">10. brushdirectory</a></strong></p>
<p><a href="http://www.brushdirectory.com/"><img class="alignleft size-medium wp-image-398" title="brushdirectory-com" src="http://www.web7.co/wp-content/uploads/2011/07/brushdirectory-com-300x268.png" alt="brushdirectory" width="300" height="268" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/great-css-menu-navigation-tutorials-and-collection/" rel="bookmark" class="crp_title">Great CSS Menu Navigation tutorials and collection</a></li><li><a href="http://www.web7.co/upgrade-your-wordpress-blog-or-site-for-free/" rel="bookmark" class="crp_title">Upgrade your wordpress blog or site for FREE</a></li><li><a href="http://www.web7.co/how-to-implement-rpx-social-in-cakephp/" rel="bookmark" class="crp_title">How to implement RPX social in cakephp?</a></li><li><a href="http://www.web7.co/get-free-ajax-loader-images-online/" rel="bookmark" class="crp_title">Get free ajax loader images online</a></li><li><a href="http://www.web7.co/caching-problem-models-cakephp/" rel="bookmark" class="crp_title">Caching problem with models in CakePHP</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/photoshop-brushes-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read CSV file in CakePHP</title>
		<link>http://www.web7.co/read-csv-file-cakephp/</link>
		<comments>http://www.web7.co/read-csv-file-cakephp/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 15:35:42 +0000</pubDate>
		<dc:creator>cakebit</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=367</guid>
		<description><![CDATA[First download class file for reading CSV file from here. Now copy the main class file to your app/vendors/ and name it parsecsv.php. Now in your controller’s action where you want to read CSV data, import that file using App::import function, function readCSV&#40;&#41; &#123; App::import&#40;&#34;Vendor&#34;,&#34;parsecsv&#34;&#41;; &#125; Then create object of the class, function readCSV&#40;&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>First download class file  for reading CSV file from <a href="http://code.google.com/p/parsecsv-for-php/" target="_blank">here</a>.</p>
<p>Now copy the main  class file to your app/vendors/ and name it parsecsv.php.</p>
<p>Now in your  controller’s action where you want to read CSV data, import that file  using App::import function,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> readCSV<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Vendor&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;parsecsv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then create object of  the class,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> readCSV<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Vendor&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;parsecsv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> parseCSV<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To read a CSV file,  you have to use the following function,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$csv</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>auto<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filepath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// here $filepath is absolute path of your CSV file with filename,</span></pre></div></div>

<p>It reads data from  file and stores in <em>$csv-&gt;data</em> in array format.</p>
<p>Now you can get data  using loop as following,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$csv</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>data <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$temp1</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name1’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$temp2</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name2’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$temp3</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name3’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//other stuff</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Final code looks like  below,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> readCSV<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Vendor&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;parsecsv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> parseCSV<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$csv</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>auto<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filepath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$csv</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>data  <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$temp1</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name1’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$temp2</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name2’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$temp3</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘column_name3’<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//other stuff</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/" rel="bookmark" class="crp_title">cakephp session setflash with cool jquery effects</a></li><li><a href="http://www.web7.co/how-to-implement-rpx-social-in-cakephp/" rel="bookmark" class="crp_title">How to implement RPX social in cakephp?</a></li><li><a href="http://www.web7.co/jquery-check-whether-checkbox-is-checked-or-not/" rel="bookmark" class="crp_title">jQuery: check whether checkbox is checked or not</a></li><li><a href="http://www.web7.co/cakephp-model-level-validation-overview-getting-started/" rel="bookmark" class="crp_title">CakePHP model level validation : Overview &#038; getting started</a></li><li><a href="http://www.web7.co/mysql-auto-increment-mysql-table-php/" rel="bookmark" class="crp_title">MySQL : Get next auto increment value in a MySQL table using PHP</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/read-csv-file-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate WordPress into CakePHP</title>
		<link>http://www.web7.co/integrate-wordpress-into-cakephp/</link>
		<comments>http://www.web7.co/integrate-wordpress-into-cakephp/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 15:25:23 +0000</pubDate>
		<dc:creator>cakebit</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=364</guid>
		<description><![CDATA[Sometimes ago I was working on a project based on CakePHP framework. And requirement was to integrate a blogging application into CakePHP. Well, everyone knows that WordPress is the best Blog framework ever made. So I decided to integrate WordPress into CakePHP. Now, the first thing is if you want to integrate WordPress in CakePHP, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes ago I was working on a project based on CakePHP framework. And requirement was to integrate a blogging application into CakePHP.</p>
<p>Well, everyone knows that WordPress is the best Blog framework ever made. So I decided to integrate WordPress into CakePHP.</p>
<p>Now, the first thing is if you want to integrate WordPress in CakePHP, you have to put that in app/webroot folder. So, put WordPress folder into app/webroot of your CakePHP.</p>
<p>But cake doesn’t keep the address to http://www.example.com/blog/  but it changes address to http://www.example.com/app/webroot/blog/.</p>
<p>After doing some research, I found the solution for this that I have to edit .htaccess file to rewrite the url address.</p>
<p>Now open .htaccess file from your CakePHP root directory and replace the content with following lines.</p>
<p>RewriteEngine on<br />
RedirectMatch temp ^/blog/wp-admin$ http://www.example.com/blog/<br />
RewriteRule ^blog$ blog/ [L]<br />
RewriteRule ^blog/wp-admin$ blog/wp-admin/ [L]<br />
RewriteRule ^$ app/webroot/    [L]<br />
RewriteRule (.*) app/webroot/$1 [L]</p>
<p>…and it works for my case.</p>
<p>Hope this will help.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/upgrade-your-wordpress-blog-or-site-for-free/" rel="bookmark" class="crp_title">Upgrade your wordpress blog or site for FREE</a></li><li><a href="http://www.web7.co/launched-my-own-blog/" rel="bookmark" class="crp_title">Launched my own blog</a></li><li><a href="http://www.web7.co/caching-problem-models-cakephp/" rel="bookmark" class="crp_title">Caching problem with models in CakePHP</a></li><li><a href="http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/" rel="bookmark" class="crp_title">cakephp session setflash with cool jquery effects</a></li><li><a href="http://www.web7.co/cakephp-model-level-validation-overview-getting-started/" rel="bookmark" class="crp_title">CakePHP model level validation : Overview &#038; getting started</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/integrate-wordpress-into-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL : Get next auto increment value in a MySQL table using PHP</title>
		<link>http://www.web7.co/mysql-auto-increment-mysql-table-php/</link>
		<comments>http://www.web7.co/mysql-auto-increment-mysql-table-php/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 18:20:24 +0000</pubDate>
		<dc:creator>cakebit</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[auto-increment]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=333</guid>
		<description><![CDATA[Recently, I needed to get the auto increment value for the next inserted row in a MySQL table. As the first solution, I was thinking to get maximum of ‘id’ field and then increment it for next inserted record like, $query = mysql_query&#40;SELECT MAX&#40;id&#41; as max_id FROM tablename&#41;; $row = mysql_fetch_array&#40;$query&#41;; $next_id = $row&#91;‘max_id’&#93; + [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed to get the auto increment value for the next inserted row in a MySQL table.</p>
<p>As the first solution, I was thinking to get maximum of ‘id’ field and then increment it for next inserted record like,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span>SELECT <span style="color: #990000;">MAX</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> max_id FROM tablename<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$next_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span>‘max_id’<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>But it is not a right way to do this because auto increment values use unique ids.</p>
<p>By doing some research, I found a solution for this problem. You can use “SHOW TABLE STATUS” query like,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SHOW TABLE STATUS LIKE 'table_name'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$auto_increment</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Auto_increment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_free_result</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This command returns a two dimentional array with “Auto_increment” value.</p>
<p>There is another solution for this. You could use direct select query like,</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span> <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'tablename'</span> <span style="color: #993333; font-weight: bold;">AND</span> TABLE_SCHEMA<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'database_name'</span>;</pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/mysql-tuning-getting-the-most-out-of-your-database/" rel="bookmark" class="crp_title">MySQL Tuning: Getting the most out of your database</a></li><li><a href="http://www.web7.co/caching-problem-models-cakephp/" rel="bookmark" class="crp_title">Caching problem with models in CakePHP</a></li><li><a href="http://www.web7.co/country-select-box/" rel="bookmark" class="crp_title">Country select box</a></li><li><a href="http://www.web7.co/read-csv-file-cakephp/" rel="bookmark" class="crp_title">Read CSV file in CakePHP</a></li><li><a href="http://www.web7.co/update-twitter-status-remotely-cakephp-component/" rel="bookmark" class="crp_title">update twitter status remotely using cakephp component</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/mysql-auto-increment-mysql-table-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to abort an ajax request using jQuery</title>
		<link>http://www.web7.co/abort-ajax-request-jquery/</link>
		<comments>http://www.web7.co/abort-ajax-request-jquery/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 20:03:59 +0000</pubDate>
		<dc:creator>cakebit</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=325</guid>
		<description><![CDATA[The $.ajax method returns the xhr object, and you can call the abort method of it. Every time you create an ajax request you could use a variable to store it: var x = $.ajax&#40;&#123; type: 'POST', url: 'someurl', success: function&#40;result&#41;&#123;&#125; &#125;&#41;; Then you can abort the request: x.abort&#40;&#41;; Related Posts:jQuery: check whether checkbox is [...]]]></description>
			<content:encoded><![CDATA[<p>The $.ajax method returns the xhr object, and you can call the<br />
abort method of it.</p>
<p>Every time you create an ajax request you could use a variable to store it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'POST'</span><span style="color: #339933;">,</span>
url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'someurl'</span><span style="color: #339933;">,</span>
success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then you can abort the request:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">x.<span style="color: #660066;">abort</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/jquery-check-whether-checkbox-is-checked-or-not/" rel="bookmark" class="crp_title">jQuery: check whether checkbox is checked or not</a></li><li><a href="http://www.web7.co/check-whether-javascript-variable-is-defined/" rel="bookmark" class="crp_title">Check whether javascript variable is defined</a></li><li><a href="http://www.web7.co/get-parent-element-using-jquery/" rel="bookmark" class="crp_title">Get parent element using jQuery</a></li><li><a href="http://www.web7.co/get-free-ajax-loader-images-online/" rel="bookmark" class="crp_title">Get free ajax loader images online</a></li><li><a href="http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/" rel="bookmark" class="crp_title">cakephp session setflash with cool jquery effects</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/abort-ajax-request-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caching problem with models in CakePHP</title>
		<link>http://www.web7.co/caching-problem-models-cakephp/</link>
		<comments>http://www.web7.co/caching-problem-models-cakephp/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 17:52:57 +0000</pubDate>
		<dc:creator>cakebit</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.web7.co/?p=320</guid>
		<description><![CDATA[Before a few days, I was working on a project in CakePHP. I made some model related changes, like changed the relationship of models and added new fields to table in database. After uploading the code to live server, when I checked the site, no difference was seen as compared to earlier version of site. [...]]]></description>
			<content:encoded><![CDATA[<p>Before a few days, I was working on a project in CakePHP. I made some model related changes, like changed the relationship of models and added new fields to table in database.</p>
<p>After uploading the code to live server, when I checked the site, no difference was seen as compared to earlier version of site. I wondered what had happened. Where have all the changes gone or why no change has been applied even though I changed the code in models?</p>
<p>Everything was working fine, except that the changes in model and database were not reflected.</p>
<p>I contemplated a lot, then I realized that I should have cleared the cache of models.</p>
<p>So for that I deleted cache folder in /app/tmp/ and voila, everything worked fine. I had found the solution.</p>
<p>There is another trick [which actually does the same thing as above] for solving this problem :</p>
<p>&gt; First change the debug level to 3 in your core.php file.<br />
&gt; Reload your application in browser.<br />
&gt; Change the debug level back to 0.</p>
<p>That’s it.</p>
<p>So remember, any time you add a new model or adjust your associations or make changes in structure of your database table, be sure to delete the cache folder from the /app/tmp/ folder.</p>
<p>&nbsp;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/integrate-wordpress-into-cakephp/" rel="bookmark" class="crp_title">Integrate WordPress into CakePHP</a></li><li><a href="http://www.web7.co/mysql-tuning-getting-the-most-out-of-your-database/" rel="bookmark" class="crp_title">MySQL Tuning: Getting the most out of your database</a></li><li><a href="http://www.web7.co/mysql-auto-increment-mysql-table-php/" rel="bookmark" class="crp_title">MySQL : Get next auto increment value in a MySQL table using PHP</a></li><li><a href="http://www.web7.co/cakephp-model-level-validation-overview-getting-started/" rel="bookmark" class="crp_title">CakePHP model level validation : Overview &#038; getting started</a></li><li><a href="http://www.web7.co/jquery-check-whether-checkbox-is-checked-or-not/" rel="bookmark" class="crp_title">jQuery: check whether checkbox is checked or not</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/caching-problem-models-cakephp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to implement RPX social in cakephp?</title>
		<link>http://www.web7.co/how-to-implement-rpx-social-in-cakephp/</link>
		<comments>http://www.web7.co/how-to-implement-rpx-social-in-cakephp/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 19:25:52 +0000</pubDate>
		<dc:creator>webdevbit</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[RPX]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[social login]]></category>

		<guid isPermaLink="false">http://www.gautamlakum.com/?p=296</guid>
		<description><![CDATA[Whua there, I have appeared after 1 month with new post. I know, it&#8217;s been too long. But anyways, let&#8217;s start something new. I am here with little new topic, i.e. how to implement RPX social in cakephp. What is RPX social? RPX is a third party tool that allows users to log in to [...]]]></description>
			<content:encoded><![CDATA[<p>Whua there, I have appeared after 1 month with new post. I know, it&#8217;s been too long. But anyways, let&#8217;s start something new. I am here with little new topic, i.e. how to implement RPX social in cakephp.</p>
<p><strong>What is RPX social?</strong></p>
<p>RPX is a third party tool that allows users to log in to our site using other social site&#8217;s login details like Google, Yahoo, Facebook, twitter and more. RPX is now called <a href="https://rpxnow.com/" target="_blank">Janrain</a>. It provides different services like Social engage/login, social sharing, getting user profile data and invite friends. Janrain Engage helps connect your site to the social web through a robust set of APIs and social widget interfaces. Ultimately, a Janrain Engage solution accelerates your user registration and sign-in process by quickly and easily converting anonymous site visitors into active registered users. In addition, Janrain Engage enables you to import a rich set of profile data and social graphs from your users&#8217; social networks allowing you to gain both deeper insight into your users, keep their profiles up to date, and transform your site into a more social destination. Please visit http://www.janrain.com/products/engage for more about RPX.<br />
I have implemented Social login using RPX. So I am going to share how to implement it in your CakePHP application. So, here we go.</p>
<p>There are two methods to implement it.<br />
<strong>1) iframe based<br />
2) Popup based</strong></p>
<p>I will start with implementing it iframe base.</p>
<p><strong>Step 1:</strong></p>
<p>Define constants in bootstrap file of your CakePHP application. You will find it /app/config/bootstrap.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TOKEN_URL'</span><span style="color: #339933;">,</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #666666; font-style: italic;">/* URL you want your token to be sent */</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
For e.g. define('TOKEN_URL', urlencode('http://localhost/project/users/login'));
*/</span>
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RPX_URL'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://webdevbit.rpxnow.com/openid/embed?token_url='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RPX_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Get your own RPX key from rpxnow.com</span></pre></div></div>

<p>Here is few screenshots that will guide you to create RPX application and get RPX API key and more.</p>
<div id="attachment_298" class="wp-caption alignleft" style="width: 310px"><a href="http://www.web7.co/wp-content/uploads/2011/02/rpxnow_com_createapp_basic.png"><img class="size-medium wp-image-298" title="rpxnow_com_createapp_basic" src="http://www.web7.co/wp-content/uploads/2011/02/rpxnow_com_createapp_basic-300x141.png" alt="" width="300" height="141" /></a><p class="wp-caption-text">Creating your RPX application</p></div>
<p>&nbsp;</p>
<div id="attachment_299" class="wp-caption alignleft" style="width: 310px"><a href="http://www.web7.co/wp-content/uploads/2011/02/rpxnow_com_relying_parties_webdevbit.png"><img class="size-medium wp-image-299" title="rpxnow_com_relying_parties_webdevbit" src="http://www.web7.co/wp-content/uploads/2011/02/rpxnow_com_relying_parties_webdevbit-300x202.png" alt="" width="300" height="202" /></a><p class="wp-caption-text">Getting your RPX application URL and API key</p></div>
<p>&nbsp;</p>
<p><strong>Step 2:</strong></p>
<p>Add following code to your .ctp file where you want the RPX login form.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>iframe src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;lt;?php echo RPX_URL.TOKEN_URL; ?&amp;gt;&quot;</span> scrolling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;no&quot;</span> frameBorder<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;no&quot;</span> allowtransparency<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:400px;height:240px&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;/</span>iframe<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Above code will display RPX login form in specific .ctp file. It will look like this.</p>
<div id="attachment_297" class="wp-caption alignleft" style="width: 310px"><a href="http://www.web7.co/wp-content/uploads/2011/02/rpx_users_login.png"><img class="size-medium wp-image-297" title="rpx_users_login" src="http://www.web7.co/wp-content/uploads/2011/02/rpx_users_login-300x202.png" alt="RPX login - webdevbit by Gautam Lakum" width="300" height="202" /></a><p class="wp-caption-text">RPX login - webdevbit</p></div>
<p>That&#8217;s it. Now let us see, how to get data from RPX token.</p>
<p><strong>Step 3:</strong></p>
<p>RPX will redirect you to the TOKEN_URL that you have defined in bootstrap.php file. You can extract the profile data using that token. Here is how you can do it.<br />
We have set token URL /users/login in bootstrap, so we will create login action in users_controller.php file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> social_login<span style="color: #009900;">&#40;</span><span style="color: #000088;">$token</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #000088;">$post_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                         <span style="color: #0000ff;">'apiKey'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> RPX_KEY<span style="color: #339933;">,</span>
                         <span style="color: #0000ff;">'format'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'json'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$curl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">'https://rpxnow.com/api/v2/auth_info'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$post_data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$raw_json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$auth_info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$raw_json</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$auth_info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'stat'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ok'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$profile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$auth_info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'profile'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">// You will get user's social profile information including email, full name, username, provider, photo url, etc.</span>
          <span style="color: #666666; font-style: italic;">// You can use them to log user in or let him/her register in your site</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #666666; font-style: italic;">// gracefully handle the error.  Hook this into your native error handling system.</span>
          <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'An error occured: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$auth_info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msg'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now you are done with your RPX implementation.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/photoshop-brushes-collection/" rel="bookmark" class="crp_title">Photoshop brushes collection</a></li><li><a href="http://www.web7.co/upgrade-your-wordpress-blog-or-site-for-free/" rel="bookmark" class="crp_title">Upgrade your wordpress blog or site for FREE</a></li><li><a href="http://www.web7.co/get-free-ajax-loader-images-online/" rel="bookmark" class="crp_title">Get free ajax loader images online</a></li><li><a href="http://www.web7.co/great-css-menu-navigation-tutorials-and-collection/" rel="bookmark" class="crp_title">Great CSS Menu Navigation tutorials and collection</a></li><li><a href="http://www.web7.co/update-twitter-status-remotely-cakephp-component/" rel="bookmark" class="crp_title">update twitter status remotely using cakephp component</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/how-to-implement-rpx-social-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>update twitter status remotely using cakephp component</title>
		<link>http://www.web7.co/update-twitter-status-remotely-cakephp-component/</link>
		<comments>http://www.web7.co/update-twitter-status-remotely-cakephp-component/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 20:03:54 +0000</pubDate>
		<dc:creator>webdevbit</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.gautamlakum.com/?p=281</guid>
		<description><![CDATA[Twitter is widely used social site for marketing and publishing your thoughts and lots of more. Here I have script to login and update twitter status remotely. I have implemented it in my project as a component and want to share it with you. So here we go for it. /app/controllers/components/twitter_post.php &#60;?php &#160; class TwitterPost [...]]]></description>
			<content:encoded><![CDATA[<p>Twitter is widely used social site for marketing and publishing your thoughts and lots of more. Here I have script to login and update twitter status remotely. I have implemented it in my project as a component and want to share it with you.</p>
<p>So here we go for it.</p>
<p>/app/controllers/components/twitter_post.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> TwitterPost <span style="color: #000000; font-weight: bold;">extends</span> Object <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> login_tweet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$return</span> <span style="color: #0000ff;">&quot;Missing parameter.&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//response can be json / xml</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">/* work */</span>
			<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">shell_exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'curl http://twitter.com/statuses/update.'</span><span style="color: #339933;">.</span><span style="color: #000088;">$format</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' -u '</span><span style="color: #339933;">.</span><span style="color: #000088;">$username</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">.</span><span style="color: #000088;">$password</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' -d status=&quot;'</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Do not forget to add this component into your controller.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$component</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TwitterPost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can use this component in your controller like this.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> tweet<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #339933;">.......</span>
	<span style="color: #339933;">.......</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">TwitterPost</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">login_tweet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tweet_account_name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'********'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'This is my first tweet. Thank you.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'json'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//$this-&gt;TwitterPost-&gt;login_tweet('tweet_account_name', '********', 'This is my first tweet. Thank you.', 'xml');</span>
	<span style="color: #339933;">.......</span>
	<span style="color: #339933;">.......</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<h3>The XML Response</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;status&gt;
	 &lt;created_at&gt;Tue Mar 17 14:45:05 +0000 2009&lt;/created_at&gt;
	 &lt;id&gt;1342408809&lt;/id&gt;
	 &lt;text&gt;Web Dev Bit. http://www.gautamlakum.com/&lt;/text&gt;
	 &lt;source&gt;web&lt;/source&gt;
	 &lt;truncated&gt;false&lt;/truncated&gt;
	 &lt;in_reply_to_status_id&gt;&lt;/in_reply_to_status_id&gt;
	 &lt;in_reply_to_user_id&gt;&lt;/in_reply_to_user_id&gt;
	 &lt;favorited&gt;false&lt;/favorited&gt;
	 &lt;in_reply_to_screen_name&gt;&lt;/in_reply_to_screen_name&gt;
	 &lt;user&gt;
	 &lt;id&gt;15759583&lt;/id&gt;
	 &lt;name&gt;davidwalshblog&lt;/name&gt;
	 &lt;screen_name&gt;davidwalshblog&lt;/screen_name&gt;
	 &lt;location&gt;Madison, WI, US&lt;/location&gt;
	 &lt;description&gt;&lt;/description&gt;
	 &lt;profile_image_url&gt;http://s3.amazonaws.com/twitter_production/profile_images/57860553/footer-logo_normal.jpg&lt;/profile_image_url&gt;
	 &lt;url&gt;http://davidwalsh.name&lt;/url&gt;
	 &lt;protected&gt;false&lt;/protected&gt;
	 &lt;followers_count&gt;960&lt;/followers_count&gt;
	 &lt;/user&gt;
&lt;/status&gt;</pre></div></div>

<h3>The JSON Response</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
	 <span style="color: #0000ff;">&quot;user&quot;</span><span style="color: #339933;">:</span>
	 <span style="color: #009900;">&#123;</span>
		 <span style="color: #0000ff;">&quot;profile_image_url&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/57860553\/footer-logo_normal.jpg&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;screen_name&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;webdevbit&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;url&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;http:\/\/www.gautamlakum.com&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;davidwalshblog&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;protected&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;followers_count&quot;</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">960</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;location&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;Madison, WI, US&quot;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">15759583</span>
	 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;text&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;Web Dev Bit. http:\/\/www.gautamlakum.com\/&quot;</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;in_reply_to_user_id&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;in_reply_to_status_id&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;created_at&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;Tue Mar 17 14:45:05 +0000 2009&quot;</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;in_reply_to_screen_name&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;truncated&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;favorited&quot;</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">1342408809</span><span style="color: #339933;">,</span>
	 <span style="color: #0000ff;">&quot;source&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;web&quot;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Thanks to <a href="http://davidwalsh.name/">http://davidwalsh.name/</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/how-to-implement-rpx-social-in-cakephp/" rel="bookmark" class="crp_title">How to implement RPX social in cakephp?</a></li><li><a href="http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/" rel="bookmark" class="crp_title">cakephp session setflash with cool jquery effects</a></li><li><a href="http://www.web7.co/cakephp-model-level-validation-overview-getting-started/" rel="bookmark" class="crp_title">CakePHP model level validation : Overview &#038; getting started</a></li><li><a href="http://www.web7.co/get-parent-element-using-jquery/" rel="bookmark" class="crp_title">Get parent element using jQuery</a></li><li><a href="http://www.web7.co/launched-my-own-blog/" rel="bookmark" class="crp_title">Launched my own blog</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/update-twitter-status-remotely-cakephp-component/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>cakephp session setflash with cool jquery effects</title>
		<link>http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/</link>
		<comments>http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 13:29:40 +0000</pubDate>
		<dc:creator>webdevbit</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.gautamlakum.com/?p=197</guid>
		<description><![CDATA[Hi there, I have something new for cakephp developers to customize their setflash messages. I can&#8217;t say it much different, but I have added some cool css and jquery effects to it. So it looks different then simple cakephp flash message. So let us start. 1. Add jquery file to your layout or view file. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there, I have something new for cakephp developers to customize their setflash messages. I can&#8217;t say it much different, but I have added some cool css and jquery effects to it. So it looks different then simple cakephp flash message. So let us start.</p>
<p><strong>1. Add jquery file</strong> to your layout or view file. You can download it from <a href="http://code.jquery.com/jquery-1.4.4.js" target="_blank">here</a>(http://code.jquery.com/jquery-1.4.4.js).</p>
<p><strong>2. Add below jQuery code</strong> into your layout file or create another separate javascript file for it.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Location : /app/webroot/js/flash.js</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ready<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.cancel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>click<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>fadeOut<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>3. Create separate element or layout</strong> for session setflash message. If you are using cakephp 1.2.6 or older version, then you will need to create layout for it. And if you are using cakephp 1.3.x, then you will need to create separate element file.</p>
<p>Here is the sample code.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Location for cakephp 1.3.x : /app/views/elements/flash_good.ctp</span>
<span style="color: #666666; font-style: italic;">// Location for cakephp 1.2.x : /app/views/layouts/flash_good.ctp</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;flash_good&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cancel&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript:void(0);&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;lt;?php echo SITE_URL.SITE_ROOT; ?&amp;gt;/img/delete.png&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Close&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Location for cakephp 1.3.x : /app/views/elements/flash_bad.ctp</span>
<span style="color: #666666; font-style: italic;">// Location for cakephp 1.2.x : /app/views/layouts/flash_bad.ctp</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;flash_bad&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cancel&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript:void(0);&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;lt;?php echo /img/delete.png&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Close&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>4.</strong> Now it is time to play with some css. <strong>Add following css code</strong> to your layout or create separate css file for it.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Location : /app/webroot/css/flash.css */</span>
<span style="color: #6666ff;">.flash_good</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span> <span style="color: #993333;">repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#94DDF9</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#69CFF6</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">932px</span><span style="color: #00AA00;">;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">border-radius.htc</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.flash_bad</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span> <span style="color: #993333;">repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#FC7862</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">932px</span><span style="color: #00AA00;">;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">border-radius.htc</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.flash_good</span> img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.flash_bad</span> img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>5.</strong> Here is sample to <strong>add css and javascript</strong> file to your code. Add it between head tags.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">css</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'flash'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$javascript</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/jquery-1.4.4.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$javascript</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/flash.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>6.</strong> Here I have sample code to use in your <strong>controller file.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> editprofile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$save</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">User</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$save</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFlash</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Your profile has been saved successfully.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flash_good'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">redirect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/profile'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFlash</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'An error occured!'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flash_bad'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">redirect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/profile'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So, that&#8217;s all. I am done with this. I hope it will be helpful to you all. Let me know your feedback or changes in this.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/get-parent-element-using-jquery/" rel="bookmark" class="crp_title">Get parent element using jQuery</a></li><li><a href="http://www.web7.co/css3-tips-and-help-for-internet-explorer/" rel="bookmark" class="crp_title">CSS3 tips and help for internet explorer</a></li><li><a href="http://www.web7.co/jquery-check-whether-checkbox-is-checked-or-not/" rel="bookmark" class="crp_title">jQuery: check whether checkbox is checked or not</a></li><li><a href="http://www.web7.co/how-to-implement-rpx-social-in-cakephp/" rel="bookmark" class="crp_title">How to implement RPX social in cakephp?</a></li><li><a href="http://www.web7.co/check-whether-javascript-variable-is-defined/" rel="bookmark" class="crp_title">Check whether javascript variable is defined</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/cakephp-session-setflash-with-cool-jquery-effects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<enclosure url="http://code.jquery.com/jquery-1.4.4.js" length="183184" type="application/x-javascript; charset=utf-8" /><media:content url="http://code.jquery.com/jquery-1.4.4.js" fileSize="183184" type="application/x-javascript; charset=utf-8" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Hi there, I have something new for cakephp developers to customize their setflash messages. I can&amp;#8217;t say it much different, but I have added some cool css and jquery effects to it. So it looks different then simple cakephp flash message. So let us st</itunes:subtitle><itunes:summary>Hi there, I have something new for cakephp developers to customize their setflash messages. I can&amp;#8217;t say it much different, but I have added some cool css and jquery effects to it. So it looks different then simple cakephp flash message. So let us start. 1. Add jquery file to your layout or view file. [...]</itunes:summary><itunes:keywords>Articles, CakePHP, cakephp, flash, jquery, php, session</itunes:keywords></item>
		<item>
		<title>3 Idiots song for programmers</title>
		<link>http://www.web7.co/3-idiots-song-for-programmers/</link>
		<comments>http://www.web7.co/3-idiots-song-for-programmers/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 17:25:17 +0000</pubDate>
		<dc:creator>webdevbit</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.gautamlakum.com/?p=192</guid>
		<description><![CDATA[Hey friends, I got a song lyrics for programmers. It is very similar to very hit song of movie 3 Idiots &#8211; Give me some sunshine. One of my friend Rashmin Javiya has sent me this. Here it is. I hope you will enjoy that song. Saari umr hum coding main mar gaye Ek pal [...]]]></description>
			<content:encoded><![CDATA[<p>Hey friends, I got a song lyrics for programmers. It is very similar to very hit song of movie 3 Idiots &#8211; Give me some sunshine. One of my friend Rashmin Javiya has sent me this. Here it is. I hope you will enjoy that song.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Saari umr hum
coding main mar gaye
Ek pal to ab humein jeene <span style="color: #b1b100;">do</span>
jeene <span style="color: #b1b100;">do</span>
&nbsp;
Saari umr hum
coding main mar gaye
Ek pal to ab humein jeene <span style="color: #b1b100;">do</span>
jeene <span style="color: #b1b100;">do</span>
&nbsp;
Na na na…<span style="color: #339933;">.</span>Na na na…<span style="color: #339933;">.</span>Na na na…<span style="color: #339933;">.</span>Na na nana na…<span style="color: #339933;">.</span>
&nbsp;
Give me some flight
Give me some train
Give me another chance
I wanna go home once again
&nbsp;
Give me some flight
Give me some train
Give me another chance
I wanna go home once again
&nbsp;
Kandhon ko laptop
Ke bojh ne jhukaya
&nbsp;
Client se jhoot bolna tho khud
Manager ne sikhaya
&nbsp;
C<span style="color: #339933;">-</span><span style="color: #cc66cc;">3</span> ya D<span style="color: #339933;">-</span><span style="color: #cc66cc;">3</span> rating laaoge to chhuti<span style="color: #339933;">,</span> varna kismat futi
Code kar kar ke pada Ungaliyon pe
JAVA<span style="color: #339933;">,</span> PHP aur PERL ka chaala
&nbsp;
Is Project ne to sala poora<span style="color: #339933;">..</span>
Poora bheja pakka daala
&nbsp;
Career to gaya
BF bhi gaya
Ek pal to ab humein
jeene <span style="color: #b1b100;">do</span> jeene <span style="color: #b1b100;">do</span>
&nbsp;
Career to gaya
GF bhi gayi
Ek pal to ab humein
jeene <span style="color: #b1b100;">do</span> jeene <span style="color: #b1b100;">do</span>
&nbsp;
Saari umru hum
coding main jee liye
Ek pal to ab humein jeene <span style="color: #b1b100;">do</span>
jeene <span style="color: #b1b100;">do</span>
Na na na…<span style="color: #339933;">.</span>Na na na…<span style="color: #339933;">.</span>Na na na…<span style="color: #339933;">.</span>Na na nana na…</pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.web7.co/check-whether-javascript-variable-is-defined/" rel="bookmark" class="crp_title">Check whether javascript variable is defined</a></li><li><a href="http://www.web7.co/launched-my-own-blog/" rel="bookmark" class="crp_title">Launched my own blog</a></li><li><a href="http://www.web7.co/upgrade-your-wordpress-blog-or-site-for-free/" rel="bookmark" class="crp_title">Upgrade your wordpress blog or site for FREE</a></li><li><a href="http://www.web7.co/css3-tips-and-help-for-internet-explorer/" rel="bookmark" class="crp_title">CSS3 tips and help for internet explorer</a></li><li><a href="http://www.web7.co/create-and-manage-virtual-sub-domains-2/" rel="bookmark" class="crp_title">Create and manage virtual sub domains</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.web7.co/3-idiots-song-for-programmers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	<media:rating>nonadult</media:rating></channel>
</rss>

