<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jawad.pk &#187; PHP</title>
	<atom:link href="http://jawad.pk/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://jawad.pk/blog</link>
	<description>WEB 2.0 / RIAs Expert.</description>
	<lastBuildDate>Tue, 06 Sep 2011 12:43:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Problem running CodeIgniter over goDaddy</title>
		<link>http://jawad.pk/blog/2009/03/17/problem-running-codeigniter-over-godaddy/</link>
		<comments>http://jawad.pk/blog/2009/03/17/problem-running-codeigniter-over-godaddy/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 21:16:28 +0000</pubDate>
		<dc:creator>Jawad Khan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[godaddy]]></category>

		<guid isPermaLink="false">http://jawad.pk/blog/2009/03/17/problem-running-codeigniter-over-godaddy/</guid>
		<description><![CDATA[I have been getting &#8220;No input file specified&#8221; problem with the CodeIgniter based application. This issue has a quick fix. There will be a php.ini file in the root directory. Copy it and rename the new file as php5.ini and just add following line in it: cgi.fix_pathinfo = 1 //this directive tell PHP CGI to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been getting &#8220;No input file specified&#8221; problem with the CodeIgniter based application. This issue has a quick fix.<br />
There will be a php.ini file in the root directory. Copy it and rename the new file as php5.ini and just add following line in it:</p>
<p>cgi.fix_pathinfo = 1<br />
//this directive tell PHP CGI to fix paths to conform to the spec</p>
<p>It solved my problem and CI application worked.</p>
<p>FYI: I have written codeIgniter advantages in another post at  <a title="Zigron Blog" href="http://www.zigron.com/blog/2008/10/21/codeigniter-does-one-really-need-it/" target="_blank">zigron blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jawad.pk/blog/2009/03/17/problem-running-codeigniter-over-godaddy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using sfCryptographp with custom validation</title>
		<link>http://jawad.pk/blog/2008/07/18/using-sfcryptographp-with-custom-validation/</link>
		<comments>http://jawad.pk/blog/2008/07/18/using-sfcryptographp-with-custom-validation/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 21:11:14 +0000</pubDate>
		<dc:creator>Jawad Khan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[sfCryptographp]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://itsjawad.wordpress.com/?p=12</guid>
		<description><![CDATA[Using sfCryptographp with custom validation.. I just had to use captcha with symfony, Symfony is a great MVC framework, but i really don&#8217;t like its default validation method, rather I like javascript validations, so that user don&#8217;t have to wait for the server response after missing just a text field. So, I put mostly fields [...]]]></description>
			<content:encoded><![CDATA[<p>Using sfCryptographp with custom validation..</p>
<p>I just had to use captcha with symfony, Symfony is a great MVC framework, but i really don&#8217;t like its default validation method, rather I like javascript validations, so that user don&#8217;t have to wait for the server response after missing just a text field. So, I put mostly fields checking validations with javascript and then check at the server for the specific fields which do require server response like checking username if its unique in the database. Such validations are also possible with the quick response using Ajax, but all we need to do is to avoid symfony&#8217;s default validation method in order to achieve that.</p>
<p>Now coming back to captcha, the php-captha is a great library for the normal php apps, It can also be used with symfony, but I gave preference to symfony&#8217;s already available pluggins..<br />
so here is the pluggin: sfCryptographp<br />
its installation is pretty straight forward.</p>
<p>$ symfony plugin-install http://plugins.symfony-project.com/sfCryptographpPlugin</p>
<p>After your done with installation, enable the crypt pluggin in your settings.yml file</p>
<p>like:</p>
<p>.settings:<br />
enabled_modules:        [default, cryptographp]</p>
<p>Now, Open your template file, add following line:<br />
&lt;?php use_helper(&#8216;Cryptographp&#8217;); ?&gt;</p>
<p>Now insert following code in anywhere within the form where you want captcha to be visible.</p>
<p>&lt;?php echo cryptographp_picture(); ?&gt;<br />
&lt;?php echo cryptographp_reload(); ?&gt;</p>
<p>&lt;?php echo input_tag(&#8216;captcha&#8217;); ?&gt;</p>
<p>It was pretty easy, now if u test your template you can see captcha images, The above code lines are same as described in sfCryptographp wiki page. Now for the validation we will not follow the wiki, we will put some logic at the actions file. before we do it we need little modification in sfCryptographpValidator class, which can be found at:</p>
<p>plugins\sfCryptographpPlugin\lib\validator\sfCryptographpValidator.class.php</p>
<p>open that class</p>
<p>add another function like:</p>
<p>public function checkCode($value)<br />
{<br />
if (chk_crypt($value)) {<br />
return true;<br />
} else {<br />
return false;<br />
}</p>
<p>}</p>
<p>Now goto your actions class, put the following code at the place where you are handling form post actions.</p>
<p>// create an instance from sfCryptographpValidator class<br />
// and use the new function to validate user entered text</p>
<p>$captcha = new sfCryptographpValidator();</p>
<p>if (!$captcha-&gt;checkCode($_POST['captcha']))<br />
{<br />
//user entered wrong code&#8230;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://jawad.pk/blog/2008/07/18/using-sfcryptographp-with-custom-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

