<?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>TECHiE TALKS &#187; Programming</title>
	<atom:link href="http://www.icpep.org/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icpep.org</link>
	<description>Just another techie stuff</description>
	<lastBuildDate>Fri, 23 Jul 2010 04:53:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Bubble Sort and Graphics.h in Dev C++</title>
		<link>http://www.icpep.org/bubble-sort-and-graphics-h-in-dev-c/</link>
		<comments>http://www.icpep.org/bubble-sort-and-graphics-h-in-dev-c/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 00:49:20 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1101</guid>
		<description><![CDATA[Lately I have been searching  this post on the net about graphics.h in dev c++ and found few resources about it .  So I decided to write how to use graphics.h in dev-c++.  I am expecting that you have already installed bloodshed dev-cpp on your machine.  Graphics.h is a header file found in borlan c [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.icpep.org/wp-content/uploads/2010/07/dev-c++.jpg"><img class="size-full wp-image-1102 aligncenter" title="dev c++" src="http://www.icpep.org/wp-content/uploads/2010/07/dev-c++.jpg" alt="dev c++" width="472" height="293" /></a></p>
<p style="text-align: justify;">Lately I have been searching  this post on the net about graphics.h in dev c++ and found few resources about it .  So I decided to write how to use graphics.h in dev-c++.  I am expecting that you have already installed bloodshed dev-cpp on your machine.  Graphics.h is a header file found in borlan c but because of its late development devcpp is now the mostly used IDE and compiler in programming c++.</p>
<p style="text-align: justify;">Below are the steps on how to get graphics.h running on your machine,</p>
<ol>
<li>download <a href="icpep.org/downloads/graphics.h">graphics.h</a> and save it to the <strong>include</strong> folder where you installed dev-cpp (C:\Dev-Cpp\include)</li>
<li>Download <a title="libbgi" href="http://www.icpep.org/downloads/libbgi.a">libbgi.a</a> and save it in the <strong>lib </strong>folder where you installed dev-cpp (C:\Dev-Cpp\lib)</li>
<li>So when you have to create a program that needs the use of graphics.h  you must instruct the linker to link in certain libraries by going to <strong>projects &gt; project options &gt; parameters tab &gt; linker column </strong>copy the lines below and paste it on that column.</li>
</ol>
<pre style="padding-left: 30px;">-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32</pre>
<p>By then you should be able to use graphics.h. As a sample I created this bubble sort algorithm as an example on how to use graphics.h in c++.<span id="more-1101"></span></p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">
<div id="_mcePaste">#include &lt;iostream&gt;</div>
<div id="_mcePaste">#include &lt;graphics.h&gt;</div>
<p>#define PIXEL_COUNT 1000<br />
#define DELAY_TIME  1  /* in milliseconds */<br />
#define CLIP_ON     1</p>
<p>//using namespace std;</p>
<p>int main () {</p>
<p>int temp, x, toSort[300], loop, isSwapped=1;<br />
/* request autodetection */<br />
int gdriver = DETECT, gmode, errorcode;</p>
<p>/* initialize graphics and local variables */<br />
initgraph(&amp;gdriver, &amp;gmode, &#8220;&#8221;);</p>
<p>/* read result of initialization */<br />
errorcode = graphresult();</p>
<p>if (errorcode != grOk) {  /* an error occurred */</p>
<p>printf(&#8220;Graphics error: %s\n&#8221;, grapherrormsg(errorcode));<br />
printf(&#8220;Press any key to halt:&#8221;);<br />
getch();<br />
exit(1);               /* terminate with an error code */</p>
<p>}</p>
<p>/* Generate the numbers */<br />
for(x=0; x&lt;300; x++) {<br />
toSort[x] = rand() % 300 + 1;<br />
}</p>
<p>for(loop=0; (loop &lt;= 300)&amp;&amp; isSwapped == 1; loop++) {<br />
isSwapped = 0;<br />
for(x=0; x&lt;300; x++) {            if(toSort[x] &gt; toSort[x+1]) {</p>
<p>//swapping of data<br />
temp = toSort[x];<br />
toSort[x] = toSort[x+1];<br />
toSort[x+1] = temp;<br />
isSwapped = 1;</p>
<p>}<br />
std::cout &lt;&lt; loop &lt;&lt; &#8220;=&gt; &#8220;&lt;&lt; x &lt;&lt; &#8220;,&#8221; &lt;&lt; toSort[x] &lt;&lt; &#8221; &#8220;;</p>
<p>putpixel(x, toSort[x], 16776960);<br />
delay(DELAY_TIME);</p>
<p>}<br />
std::cout &lt;&lt; &#8220;\n\n&#8221;;<br />
if(isSwapped == 1) {<br />
cleardevice();<br />
}<br />
//loop++;<br />
}</p>
<p>//cout &lt;&lt; endl &lt;&lt; &#8220;\n\n\n&#8221;;<br />
std::cout &lt;&lt; &#8220;Loop Count: &#8221; &lt;&lt; loop &lt;&lt; &#8220;\n\n\n&#8221;;<br />
system(&#8220;pause&#8221;);<br />
return 0;<br />
}</p>
</div>
<p style="text-align: justify;">The program will have scattered points on the screen and will form a line as the loop iterates and at the end it will display how many loops are needed to sort the randomly generated numbers.</p>
<p style="text-align: justify;">If you have problems using the functions you can refer to this <a href="http://www.cs.colorado.edu/~main/bgi/doc/">link</a>.  I hope this helps in solving your problem about dev c++ graphics.h with the <strong>bubble sort algorithm</strong>.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Bubble Sort and Graphics.h in Dev C++" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Bubble+Sort+and+Graphics.h+in+Dev+C++" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/bubble-sort-and-graphics-h-in-dev-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slackware PHP GD Error</title>
		<link>http://www.icpep.org/slackware-php-gd-error/</link>
		<comments>http://www.icpep.org/slackware-php-gd-error/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 01:13:29 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Linux Webserver]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1072</guid>
		<description><![CDATA[In the past months I was able to handle a LAMP server, this is my second time to handle a UNIX based web server but this time its a lot different because I will will be the one to install and configure the web server.  Our System administrator was the one who installed the latest [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1074 aligncenter" title="slackware" src="http://www.icpep.org/wp-content/uploads/2010/06/slackware.png" alt="" width="342" height="359" /></p>
<p style="text-align: justify;">In the past months I was able to handle a LAMP server, this is my second time to handle a UNIX based web server but this time its a lot different because I will will be the one to install and configure the web server.  Our System administrator was the one who installed the latest version of slackware which is 13.1 on the machine, so all I need to do is have the web server up and running.</p>
<p style="text-align: justify;">Our system administrator did include the x packages when he installed slackware and this caused me a problem in running PHP because it gave me several errors in GD support.  The error I get was,</p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">PHP Warning:  PHP Startup: Unable to load dynamic library &#8216;/usr/lib/php/extensions/gd.so&#8217; &#8211; libxcb-xlib.so.0: cannot open shared object file: No such file or directory in Unknown on line 0</div>
<p>I was able to solve the problem with the following steps taken and was based from a <a href="http://www.linuxquestions.org/questions/linux-general-1/php-gd-problems-missing-libx11-so-6-%3D-how-to-get-it-577217/">linux forum</a> I really loved.<span id="more-1072"></span><br />
Download the packages by entering the following commands,</p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">
<ul>
<li> root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/xtrans-1.0.3-noarch-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libXdmcp-1.0.2-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libXau-1.0.3-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libX11-1.1.1-i486-4.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libXt-1.0.5-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libSM-1.0.3-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libICE-1.0.3-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libXpm-3.5.6-i486-1.tgz</li>
<li>root@icpep:~# wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.0/slackware/x/libxcb-1.0-i486-2.tgz</li>
</ul>
</div>
<p>After downloading the files I installed them using <strong>pkgtool</strong> and select install packages from current directory and by there it will display the packages downloaded. Here is a sample of how to install it using <strong>pkgtool</strong>,</p>
<p style="text-align: center;"><img class="size-full wp-image-1073 aligncenter" title="slackon" src="http://www.icpep.org/wp-content/uploads/2010/06/slackon.jpg" alt="" width="529" height="605" /></p>
<p>After installing the packages restart your apache and PHP GD support should be working. To check type this command,</p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">root@icpep:~#php -m</div>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Slackware PHP GD Error" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Slackware+PHP+GD+Error" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/slackware-php-gd-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change a String or Character in MySQL</title>
		<link>http://www.icpep.org/change-a-string-or-character-in-mysql/</link>
		<comments>http://www.icpep.org/change-a-string-or-character-in-mysql/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 05:00:01 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1066</guid>
		<description><![CDATA[Knowing the right MySQL statement is the most important part in having thousands of data in your database, one false move and you can&#8217;t undo things.    If you want to change a string or character in your database and doing it manually in thousands or millions of entries then that should consume all of your [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1067 aligncenter" title="mysql" src="http://www.icpep.org/wp-content/uploads/2010/04/mysql.jpg" alt="" width="300" height="225" /></p>
<p style="text-align: justify;">Knowing the right MySQL statement is the most important part in having thousands of data in your database, one false move and you can&#8217;t undo things.    If you want to change a string or character in your database and doing it manually in thousands or millions of entries then that should consume all of your time.</p>
<p style="text-align: justify;">One example scenario is when you want to change all the entries containing a character &#8216;_&#8217; to this character &#8216;-&#8217; .  All you need to do is have a backup first on that specific table or database so that whatever false move you  will be doing, you can still have the data back.  After having the backup here is the SQL syntax that you should enter:</p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">UPDATE Table SET Column = Replace(Column, &#8216;find value&#8217;, &#8216;replacement value&#8217;) WHERE xxx</div>
<p>Where in my scenario:</p>
<div style="border: 2px solid #CECECE; padding: 5px; background: #F1F1F1;">UPDATE paging SET pagename = Replace(pagename, &#8216;_&#8217;, &#8216;-&#8217;)</div>
<p>There within less than a minute I was able to change all the data containing &#8216;_&#8217;.  It saved me a lot of time and I can continue coding some other stuff rather than editing the data manually.  Hope this helps and happy coding!</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Change a String or Character in MySQL" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Change+a+String+or+Character+in+MySQL" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/change-a-string-or-character-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Main Domain</title>
		<link>http://www.icpep.org/getting-main-domain/</link>
		<comments>http://www.icpep.org/getting-main-domain/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 18:04:13 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1046</guid>
		<description><![CDATA[Do you want to extract the main domain of a URL?  Here is a function that works well and can be modified easily.  I found this function while searching for a good Regular Expression to fulfill such result. &#60;?php function get_base_domain($url)  { $debug = 0; $base_domain = ''; $G_TLD = array( 'biz','com','edu','gov','info','int','mil','name','net','org','aero','asia','cat','coop','jobs','mobi','museum', 'pro','tel','travel','arpa','root','berlin','bzh','cym','gal','geo','kid','kids','lat','mail','nyc','post','sco','web','xxx', 'nato','example','invalid','localhost','test','bitnet','csnet','ip','local','onion','uucp', 'co' [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify; padding-left: 30px;"><img class="size-full wp-image-1047 aligncenter" title="php" src="http://www.icpep.org/wp-content/uploads/2010/04/php.jpg" alt="" width="300" height="225" /></p>
<p style="text-align: justify;">Do you want to extract the main domain of a URL?  Here is a function that works well and can be modified easily.  I found this function while searching for a good Regular Expression to fulfill such result.</p>
<pre class="php"><span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpFunctionKeyword">function</span><span class="htmlText"> get_base_domain</span><span class="phpOperator">(</span>$url<span class="phpOperator">)</span>  <span class="phpOperator">{</span>
$debug <span class="phpOperator">=</span> 0;
$base_domain <span class="phpOperator">=</span> <span class="phpString">''</span><span class="phpText">;</span>
$G_TLD <span class="phpOperator">=</span> <span class="phpFunction">array</span><span class="phpOperator">(</span>
<span class="phpString">'biz'</span>,<span class="phpString">'com'</span>,<span class="phpString">'edu'</span>,<span class="phpString">'gov'</span>,<span class="phpString">'info'</span>,<span class="phpString">'int'</span>,<span class="phpString">'mil'</span>,<span class="phpString">'name'</span>,<span class="phpString">'net'</span>,<span class="phpString">'org'</span>,<span class="phpString">'aero'</span>,<span class="phpString">'asia'</span>,<span class="phpString">'cat'</span>,<span class="phpString">'coop'</span>,<span class="phpString">'jobs'</span>,<span class="phpString">'mobi'</span>,<span class="phpString">'museum'</span>,
<span class="phpString">'pro'</span>,<span class="phpString">'tel'</span>,<span class="phpString">'travel'</span>,<span class="phpString">'arpa'</span>,<span class="phpString">'root'</span>,<span class="phpString">'berlin'</span>,<span class="phpString">'bzh'</span>,<span class="phpString">'cym'</span>,<span class="phpString">'gal'</span>,<span class="phpString">'geo'</span>,<span class="phpString">'kid'</span>,<span class="phpString">'kids'</span>,<span class="phpString">'lat'</span>,<span class="phpString">'mail'</span>,<span class="phpString">'nyc'</span>,<span class="phpString">'post'</span>,<span class="phpString">'sco'</span>,<span class="phpString">'web'</span>,<span class="phpString">'xxx'</span>,
<span class="phpString">'nato'</span>,<span class="phpString">'example'</span>,<span class="phpString">'invalid'</span>,<span class="phpString">'localhost'</span>,<span class="phpString">'test'</span>,<span class="phpString">'bitnet'</span>,<span class="phpString">'csnet'</span>,<span class="phpString">'ip'</span>,<span class="phpString">'local'</span>,<span class="phpString">'onion'</span>,<span class="phpString">'uucp'</span>,
<span class="phpString">'co'</span> <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpComment">// country tlds <span class="phpOperator">(</span><span class="htmlText">source</span><span class="phpOperator">:</span><span class="htmlText"> http</span><span class="phpOperator">:</span>//en<span class="phpOperator">.</span>wikipedia.org/wiki/Country_code_top-level_domain<span class="phpOperator">)</span>
</span>$C_TLD <span class="phpOperator">=</span> <span class="phpFunction">array</span><span class="phpOperator">(</span>
<span class="phpString">'ac'</span>,<span class="phpString">'ad'</span>,<span class="phpString">'ae'</span>,<span class="phpString">'af'</span>,<span class="phpString">'ag'</span>,<span class="phpString">'ai'</span>,<span class="phpString">'al'</span>,<span class="phpString">'am'</span>,<span class="phpString">'an'</span>,<span class="phpString">'ao'</span>,<span class="phpString">'aq'</span>,<span class="phpString">'ar'</span>,<span class="phpString"><span class="phpKeyword">'as'</span></span>,<span class="phpString">'at'</span>,<span class="phpString">'au'</span>,<span class="phpString">'aw'</span>,<span class="phpString">'ax'</span>,<span class="phpString">'az'</span>,
<span class="phpString">'ba'</span>,<span class="phpString">'bb'</span>,<span class="phpString">'bd'</span>,<span class="phpString">'be'</span>,<span class="phpString">'bf'</span>,<span class="phpString">'bg'</span>,<span class="phpString">'bh'</span>,<span class="phpString">'bi'</span>,<span class="phpString">'bj'</span>,<span class="phpString">'bm'</span>,<span class="phpString">'bn'</span>,<span class="phpString">'bo'</span>,<span class="phpString">'br'</span>,<span class="phpString">'bs'</span>,<span class="phpString">'bt'</span>,<span class="phpString">'bw'</span>,<span class="phpString">'by'</span>,<span class="phpString">'bz'</span>,
<span class="phpString">'ca'</span>,<span class="phpString">'cc'</span>,<span class="phpString">'cd'</span>,<span class="phpString">'cf'</span>,<span class="phpString">'cg'</span>,<span class="phpString">'ch'</span>,<span class="phpString">'ci'</span>,<span class="phpString">'ck'</span>,<span class="phpString">'cl'</span>,<span class="phpString">'cm'</span>,<span class="phpString">'cn'</span>,<span class="phpString">'co'</span>,<span class="phpString">'cr'</span>,<span class="phpString">'cu'</span>,<span class="phpString">'cv'</span>,<span class="phpString">'cx'</span>,<span class="phpString">'cy'</span>,<span class="phpString">'cz'</span>,
<span class="phpString">'de'</span>,<span class="phpString">'dj'</span>,<span class="phpString">'dk'</span>,<span class="phpString">'dm'</span>,<span class="phpString"><span class="phpKeyword">'do'</span></span>,<span class="phpString">'dz'</span>,<span class="phpString">'ec'</span>,<span class="phpString">'ee'</span>,<span class="phpString">'eg'</span>,<span class="phpString">'er'</span>,<span class="phpString">'es'</span>,<span class="phpString">'et'</span>,<span class="phpString">'eu'</span>,<span class="phpString">'fi'</span>,<span class="phpString">'fj'</span>,<span class="phpString">'fk'</span>,<span class="phpString">'fm'</span>,<span class="phpString">'fo'</span>,
<span class="phpString">'fr'</span>,<span class="phpString">'ga'</span>,<span class="phpString">'gd'</span>,<span class="phpString">'ge'</span>,<span class="phpString">'gf'</span>,<span class="phpString">'gg'</span>,<span class="phpString">'gh'</span>,<span class="phpString">'gi'</span>,<span class="phpString">'gl'</span>,<span class="phpString">'gm'</span>,<span class="phpString">'gn'</span>,<span class="phpString">'gp'</span>,<span class="phpString">'gq'</span>,<span class="phpString">'gr'</span>,<span class="phpString">'gs'</span>,<span class="phpString">'gt'</span>,<span class="phpString">'gu'</span>,<span class="phpString">'gw'</span>,
<span class="phpString">'gy'</span>,<span class="phpString">'hk'</span>,<span class="phpString">'hm'</span>,<span class="phpString">'hn'</span>,<span class="phpString">'hr'</span>,<span class="phpString">'ht'</span>,<span class="phpString">'hu'</span>,<span class="phpString">'id'</span>,<span class="phpString">'ie'</span>,<span class="phpString">'il'</span>,<span class="phpString">'im'</span>,<span class="phpString">'in'</span>,<span class="phpString">'io'</span>,<span class="phpString">'iq'</span>,<span class="phpString">'ir'</span>,<span class="phpString">'is'</span>,<span class="phpString">'it'</span>,<span class="phpString">'je'</span>,
<span class="phpString">'jm'</span>,<span class="phpString">'jo'</span>,<span class="phpString">'jp'</span>,<span class="phpString">'ke'</span>,<span class="phpString">'kg'</span>,<span class="phpString">'kh'</span>,<span class="phpString">'ki'</span>,<span class="phpString">'km'</span>,<span class="phpString">'kn'</span>,<span class="phpString">'kr'</span>,<span class="phpString">'kw'</span>,<span class="phpString">'ky'</span>,<span class="phpString">'kz'</span>,<span class="phpString">'la'</span>,<span class="phpString">'lb'</span>,<span class="phpString">'lc'</span>,<span class="phpString">'li'</span>,<span class="phpString">'lk'</span>,
<span class="phpString">'lr'</span>,<span class="phpString">'ls'</span>,<span class="phpString">'lt'</span>,<span class="phpString">'lu'</span>,<span class="phpString">'lv'</span>,<span class="phpString">'ly'</span>,<span class="phpString">'ma'</span>,<span class="phpString">'mc'</span>,<span class="phpString">'md'</span>,<span class="phpString">'mg'</span>,<span class="phpString">'mh'</span>,<span class="phpString">'mk'</span>,<span class="phpString">'ml'</span>,<span class="phpString">'mm'</span>,<span class="phpString">'mn'</span>,<span class="phpString">'mo'</span>,<span class="phpString">'mp'</span>,<span class="phpString">'mq'</span>,
<span class="phpString">'mr'</span>,<span class="phpString">'ms'</span>,<span class="phpString">'mt'</span>,<span class="phpString">'mu'</span>,<span class="phpString">'mv'</span>,<span class="phpString">'mw'</span>,<span class="phpString">'mx'</span>,<span class="phpString">'my'</span>,<span class="phpString">'mz'</span>,<span class="phpString">'na'</span>,<span class="phpString">'nc'</span>,<span class="phpString">'ne'</span>,<span class="phpString">'nf'</span>,<span class="phpString">'ng'</span>,<span class="phpString">'ni'</span>,<span class="phpString">'nl'</span>,<span class="phpString">'no'</span>,<span class="phpString">'np'</span>,
<span class="phpString">'nr'</span>,<span class="phpString">'nu'</span>,<span class="phpString">'nz'</span>,<span class="phpString">'om'</span>,<span class="phpString">'pa'</span>,<span class="phpString">'pe'</span>,<span class="phpString">'pf'</span>,<span class="phpString">'pg'</span>,<span class="phpString">'ph'</span>,<span class="phpString">'pk'</span>,<span class="phpString">'pl'</span>,<span class="phpString">'pn'</span>,<span class="phpString">'pr'</span>,<span class="phpString">'ps'</span>,<span class="phpString">'pt'</span>,<span class="phpString">'pw'</span>,<span class="phpString">'py'</span>,<span class="phpString">'qa'</span>,
<span class="phpString">'re'</span>,<span class="phpString">'ro'</span>,<span class="phpString">'ru'</span>,<span class="phpString">'rw'</span>,<span class="phpString">'sa'</span>,<span class="phpString">'sb'</span>,<span class="phpString">'sc'</span>,<span class="phpString">'sd'</span>,<span class="phpString">'se'</span>,<span class="phpString">'sg'</span>,<span class="phpString">'sh'</span>,<span class="phpString">'si'</span>,<span class="phpString">'sk'</span>,<span class="phpString">'sl'</span>,<span class="phpString">'sm'</span>,<span class="phpString">'sn'</span>,<span class="phpString">'sr'</span>,<span class="phpString">'st'</span>,
<span class="phpString">'sv'</span>,<span class="phpString">'sy'</span>,<span class="phpString">'sz'</span>,<span class="phpString">'tc'</span>,<span class="phpString">'td'</span>,<span class="phpString">'tf'</span>,<span class="phpString">'tg'</span>,<span class="phpString">'th'</span>,<span class="phpString">'tj'</span>,<span class="phpString">'tk'</span>,<span class="phpString">'tl'</span>,<span class="phpString">'tm'</span>,<span class="phpString">'tn'</span>,<span class="phpString">'to'</span>,<span class="phpString">'tr'</span>,<span class="phpString">'tt'</span>,<span class="phpString">'tv'</span>,<span class="phpString">'tw'</span>,
<span class="phpString">'tz'</span>,<span class="phpString">'ua'</span>,<span class="phpString">'ug'</span>,<span class="phpString">'uk'</span>,<span class="phpString">'us'</span>,<span class="phpString">'uy'</span>,<span class="phpString">'uz'</span>,<span class="phpString">'va'</span>,<span class="phpString">'vc'</span>,<span class="phpString">'ve'</span>,<span class="phpString">'vg'</span>,<span class="phpString">'vi'</span>,<span class="phpString">'vn'</span>,<span class="phpString">'vu'</span>,<span class="phpString">'wf'</span>,<span class="phpString">'ws'</span>,<span class="phpString">'ye'</span>,<span class="phpString">'yu'</span>,
<span class="phpString">'za'</span>,<span class="phpString">'zm'</span>,<span class="phpString">'zw'</span>,<span class="phpString">'eh'</span>,<span class="phpString">'kp'</span>,<span class="phpString">'me'</span>,<span class="phpString">'rs'</span>,<span class="phpString">'um'</span>,<span class="phpString">'bv'</span>,<span class="phpString">'gb'</span>,<span class="phpString">'pm'</span>,<span class="phpString">'sj'</span>,<span class="phpString">'so'</span>,<span class="phpString">'yt'</span>,<span class="phpString">'su'</span>,<span class="phpString">'tp'</span>,<span class="phpString">'bu'</span>,<span class="phpString">'cs'</span>,<span class="phpString">'dd'</span>,<span class="phpString">'zr'</span>
<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpComment">// get domain
</span>>if <span class="phpOperator">(</span> <span class="phpOperator">!</span>$full_domain <span class="phpOperator">=</span><span class="htmlText"> get_url_domain</span><span class="phpOperator">(</span>$url<span class="phpOperator">)</span> <span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
return </span>$base_domain<span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpComment">// now the fun
</span><span class="phpComment">//<span class="phpKeyword"> break </span>up domain, reverse
</span>$DOMAIN <span class="phpOperator">=</span> <span class="phpFunction">explode</span><span class="phpOperator">(</span><span class="phpString">'<span class="phpOperator">.</span>'</span>, $full_domain<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span> $debug <span class="phpOperator">)</span> <span class="phpFunction">print_r</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">)</span><span class="phpText">;</span>
$DOMAIN <span class="phpOperator">=</span> <span class="phpFunction">array_reverse</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span> $debug <span class="phpOperator">)</span> <span class="phpFunction">print_r</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpComment">// first check<span class="phpKeyword"> for </span>ip address
</span>>if <span class="phpOperator">(</span> <span class="phpFunction">count</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">)</span> <span class="phpOperator"><span class="phpOperator">=</span>=</span> <span class="phpNumber">4</span> &#038;amp<span class="phpText">;</span>&#038;amp<span class="phpText">;</span> <span class="phpFunction">is_numeric</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">[</span><span class="phpNumber">0</span><span class="phpOperator">]</span><span class="phpOperator">)</span> &#038;amp<span class="phpText">;</span>&#038;amp<span class="phpText">;</span> <span class="phpFunction">is_numeric</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">[</span><span class="phpNumber">3</span><span class="phpOperator">]</span><span class="phpOperator">)</span> <span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
return </span>$full_domain<span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpComment">//<span class="phpKeyword"> if </span><span class="htmlText">only </span><span class="phpNumber">2</span> domain parts, that must be our domain
</span>>if <span class="phpOperator">(</span> <span class="phpFunction">count</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">)</span> <span class="phpOperator">&lt;</span><span class="phpOperator">=</span> <span class="phpNumber">2</span> <span class="phpOperator">)</span><span class="phpKeyword"> return </span>$full_domain<span class="phpText">;</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span><span class="htmlText"> in_</span><span class="phpFunction">array</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">[</span><span class="phpNumber">0</span><span class="phpOperator">]</span>, $C_TLD<span class="phpOperator">)</span> &#038;amp<span class="phpText">;</span>&#038;amp<span class="phpText">;</span><span class="htmlText"> in_</span><span class="phpFunction">array</span><span class="phpOperator">(</span>$DOMAIN<span class="phpOperator">[</span><span class="phpNumber">1</span><span class="phpOperator">]</span>, $G_TLD<span class="phpOperator">)</span> &#038;amp<span class="phpText">;</span>&#038;amp<span class="phpText">;</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">2</span><span class="phpOperator">]</span> <span class="phpOperator">!</span><span class="phpOperator">=</span> <span class="phpString">'www'</span> <span class="phpOperator">)</span> <span class="phpOperator">{</span>
$full_domain <span class="phpOperator">=</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">2</span><span class="phpOperator">]</span> <span class="phpOperator">.</span> <span class="phpString">'<span class="phpOperator">.</span>'</span> <span class="phpOperator">.</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">1</span><span class="phpOperator">]</span> <span class="phpOperator">.</span> <span class="phpString">'<span class="phpOperator">.</span>'</span> <span class="phpOperator">.</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">0</span><span class="phpOperator">]</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpKeyword">
else </span><span class="phpOperator">{</span>
$full_domain <span class="phpOperator">=</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">1</span><span class="phpOperator">]</span> <span class="phpOperator">.</span> <span class="phpString">'<span class="phpOperator">.</span>'</span> <span class="phpOperator">.</span> $DOMAIN<span class="phpOperator">[</span><span class="phpNumber">0</span><span class="phpOperator">]</span><span class="phpText">;</span>;
<span class="phpOperator">}</span>
<span class="phpComment">// did we succeed<span class="phpOperator">?</span>
</span>>return $full_domain<span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpFunctionKeyword">function</span><span class="htmlText"> get_url_domain</span><span class="phpOperator">(</span>$url<span class="phpOperator">)</span>  <span class="phpOperator">{</span>
$domain <span class="phpOperator">=</span> <span class="phpString">''</span><span class="phpText">;</span>
$_URL <span class="phpOperator">=</span> <span class="phpFunction">parse_url</span><span class="phpOperator">(</span>$url<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpComment">// sanity check
</span>>if <span class="phpOperator">(</span> <span class="phpFunction">empty</span><span class="phpOperator">(</span>$_URL<span class="phpOperator">)</span> <span class="phpOperator">|</span><span class="phpOperator">|</span> <span class="phpFunction">empty</span><span class="phpOperator">(</span>$_URL<span class="phpOperator">[</span><span class="phpString">'host'</span><span class="phpOperator">]</span><span class="phpOperator">)</span> <span class="phpOperator">)</span>  <span class="phpOperator">{</span>
$domain <span class="phpOperator">=</span> <span class="phpString">''</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpKeyword">
else </span><span class="phpOperator">{</span>
$domain <span class="phpOperator">=</span> $_URL<span class="phpOperator">[</span><span class="phpString">'host'</span><span class="phpOperator">]</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpKeyword">
return </span>$domain<span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span></pre>
<p>To test the code we can use the function,</p>
<pre class="php">$url  <span class="phpOperator">=</span> <span class="phpString">'http<span class="phpOperator">:</span><span class="phpComment">//www<span class="phpOperator">.</span>icpep.org'</span><span class="phpText">;</span>
</span><span class="phpFunction">echo</span> get_base_domain<span class="phpOperator">(</span>$url<span class="phpOperator">)</span> <span class="phpText">;</span> // icpep.org</pre>
<p><a href="http://icpep.org/wp-content/uploads/files/get.main.domain.txt">Click here to download</a>.</p>
<p style="text-align: justify;">This code really helped me a lot.  There are a lot of Regular expressions out there but this simple approach can break all those head breaking expressions.  Btw, this function is free of use and is under GNU licensing.   Hope this functions is of big help to you also, happy coding!</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Getting Main Domain" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Getting+Main+Domain" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/getting-main-domain/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHPMyAdmin Importing Large Data</title>
		<link>http://www.icpep.org/phpmyadmin-importing-large-data/</link>
		<comments>http://www.icpep.org/phpmyadmin-importing-large-data/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 07:06:41 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ap]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=970</guid>
		<description><![CDATA[By Default phpmyadmin can import data on your mysql database up to 2MB of data and beyond that will be an error.  This has been a big problem  by most webmasters and sometimes this can be a barrier to stop improving the sites.  Before I kept on searching what to use to import a large [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-971 aligncenter" title="logo_phpmyadmin" src="http://www.icpep.org/wp-content/uploads/2009/11/logo_phpmyadmin.gif" alt="logo_phpmyadmin" width="200" height="180" /></p>
<p style="text-align: justify;">By Default phpmyadmin can import data on your mysql database up to 2MB of data and beyond that will be an error.  This has been a big problem  by most webmasters and sometimes this can be a barrier to stop improving the sites.  Before I kept on searching what to use to import a large data on my MySQL database and all I can see is BigDump.  It is a software used for large and very large MySQL Dumps which is also an option to import large data on your database.</p>
<p style="text-align: justify;">If you find BigDump a pain in the head then another way to solve the problem is to edit your php.ini file.  All you need to do is open your php.ini file and edit the line</p>
<div style="border: 2px solid #cecece; padding: 5px; background: #f1f1f1 none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">upload_max_filesize = 2M</div>
<p>Setting 2M to a larger size will fix the problem.  One problem with this is that it will affect the web server&#8217;s runtime limit and could throw an error if you dump a very large data.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for PHPMyAdmin Importing Large Data" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+PHPMyAdmin+Importing+Large+Data" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/phpmyadmin-importing-large-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Curl</title>
		<link>http://www.icpep.org/php-curl/</link>
		<comments>http://www.icpep.org/php-curl/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 19:09:37 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=922</guid>
		<description><![CDATA[If you are a web developer and having problems on Installing PHP Curl on Apache with PHP installed on Windows Operating System, below is my version of tonyspecer&#8217;s &#8220;cURL with PHP and Apache on Windows&#8220;.  The steps are simple and direct to the point. I have windows apache version 2.2.14 and PHP Version 5.2.10 installed [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-923 aligncenter" title="PHP Curl" src="http://www.icpep.org/wp-content/uploads/2009/10/PHP-Curl.jpg" alt="PHP Curl" width="453" height="419" /></p>
<p>If you are a  web developer and having problems on Installing PHP Curl on Apache with PHP installed on Windows Operating System, below is my version of <a href="http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/">tonyspecer&#8217;s</a> &#8220;<strong>cURL with PHP and Apache on Windows</strong>&#8220;.  The steps are simple and direct to the point.</p>
<p>I have windows <a href="http://httpd.apache.org/">apache</a> version 2.2.14 and <a href="http://www.php.net/downloads.php">PHP</a> Version 5.2.10 installed on my Laptop using the installers provided on the respective sites.</p>
<p>1.  Install APACHE and PHP (<em>I installed my APACHE on C:\apache and PHP on C:\php directories</em> )<br />
2.  Edit the php.ini file found in the PHP directory.<span id="more-922"></span></p>
<ul>
<li>Near line  546 set the extension directory extension_dir = &#8220;C:\php\ext&#8221;.  In my case I have my extensions files inside the ext folder. You can use any folder name as long as you set it in the php.ini file.</li>
<li>Near line 472 set register_globals = On</li>
<li>Near line 630 set session.save_path=&#8221;C:\WINDOWS\Temp&#8221; or you can set any directory</li>
</ul>
<p>3.  On the PHP folder (<em>in my case C:\php\</em>) copy the php5ts.dll file to the bin folder of your Apache (<em>C:\apache\bin</em>\)<br />
4.  On the PHP folder (<em>C:\php\</em>) copy libeay32.dll and ssleay32.dll to &#8221; C:\WINDOWS\system32&#8243;  folder<br />
5.  Download CURL for Windows found at <a href="http://curl.haxx.se/download.html">http://curl.haxx.se/download.html</a> and put it on the PHP folder (C:\php\curl)<br />
6.  Download OpenSSL for Windows found at <a href="http://www.shininglightpro.com/products/Win32OpenSSL.html">http://www.shininglightpro.com/products/Win32OpenSSL.html</a>, for me I downloaded 7MB <span>OpenSSL v0.9.8k Installer<br />
</span></p>
<ul>
<li>To some Windows Visual c++ Redistributable is recommended before OpenSSL is installed.  The windows Visual c++ Redistributable can be downloaded at Microsoft website in the link:  <a href="http://www.microsoft.com/downloads/thankyou.aspx?familyId=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&amp;displayLang=en">http://www.microsoft.com/downloads/thankyou.aspx?familyId=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&amp;displayLang=en</a></li>
</ul>
<p>7.  Check to see if you have the following file: c:\windows\system32\msvcr70.dll. If not, search for it in Google and download it to system32.  If you can&#8217;t find it in that directory click this <a href="http://www.dll-files.com/dllindex/dll-files.shtml?msvcr70">link</a> to download the file from www.dllfiles.com.  Extract the zipped file and put it in the &#8220;c:\windows\system32\&#8221;  folder.<br />
8.  Uncomment the curl line in your php.ini file to enable curl:  extension=php_curl.dll but in my case I just added the line because it is not found in my php.ini file</p>
<p>9.  Edit the Apache httpd.conf file to enable php:</p>
<ul>
<li>For newer version of Apache add at the bottom
<ul>
<li>LoadModule php5_module &#8220;C:/php/php5apache2_2.dll&#8221;</li>
</ul>
</li>
<li>Then below add Line: AddType application/x-httpd-php .php</li>
</ul>
<p>10.  Restart Apache and your curl should be working now.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for PHP Curl" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+PHP+Curl" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/php-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPMailer</title>
		<link>http://www.icpep.org/phpmailer/</link>
		<comments>http://www.icpep.org/phpmailer/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 19:47:01 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=917</guid>
		<description><![CDATA[Sending E-Mail with PHP can be simple, or it can be very complex depending on what you want to do.  PHPmailer is a free PHP software used for sending emails or should I say used for &#8220;spamming&#8221;.  Though the software has been provided for free, many developers has gone beyond its real purpose.  With a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-918 aligncenter" title="PHPmailer" src="http://www.icpep.org/wp-content/uploads/2009/10/PHPmailer.jpg" alt="PHPmailer" width="403" height="302" /></p>
<p style="text-align: justify;">Sending E-Mail with PHP can be simple, or it can be very complex depending on what you want to do.  <a href="http://sourceforge.net/projects/phpmailer/">PHPmailer</a> is a free PHP software used for sending emails or should I say used for &#8220;spamming&#8221;.  Though the software has been provided for free, many developers has gone beyond its real purpose.  With a block of IP Address , a <a href="http://www.icpep.org/install-apache-tomcat/">web server</a> with PHP installed in it is a perfect set-up for spamming. I have been using this free PHP software  also and it has saved me a lot of work and headaches.</p>
<p style="text-align: justify;">What is in PHPmailer that makes it a good tool for sending emails? Does it only support a private host or is it capable of using gmail or any other public webmail services?<span id="more-917"></span></p>
<p style="text-align: justify;">PHPMailer is an <a href="http://www.icpep.org/object-oriented-php-samples">OOP PHP</a> script designed for sending emails.  Some of the &#8220;G&#8221; features of phpmailer are:</p>
<ul>
<li>Redundant SMTP servers.</li>
<li>Supports  8bit, base64, binary, and quoted-printable encoding.</li>
<li>Supports text and HTML type of email.</li>
<li>Can send emails with multiple TOs, CCs, BCCs and REPLY-TOs.</li>
<li>Capable of Word wrap.</li>
<li>Tested on multiple SMTP servers: Gmail, Sendmail, qmail, Postfix, Imail, Exchange, Mercury, Courier.</li>
<li>Works on any win32 or &#8220;nix&#8221; platforms.</li>
<li>Capable of handling and embedded image.</li>
<li>Capable of handling multiple attachments.</li>
<li>SMTP authentication.</li>
</ul>
<p>This are only few of the capabilities of a PHPMailer.  Above all the email handlers I used PHPmailer is number one on my list because of the ease of use.  It requires less skills with amazing performance, it is  a fully featured email transfer class for PHP.  Its indeed a thumbs up for the developers!</p>
<p style="text-align: justify;">
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for PHPMailer" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+PHPMailer" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/phpmailer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Translation Services</title>
		<link>http://www.icpep.org/translation-services/</link>
		<comments>http://www.icpep.org/translation-services/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 18:17:32 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=881</guid>
		<description><![CDATA[Google has provided web developers foreign language translation api. Web content translation is not a problem anymore, with google&#8217;s Google Translate, research from different countries is now made possible. This is a big help especially for researchers on the net, we can now easily understand web contents and even text from outside sources which also [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-882 aligncenter" title="translate_logo" src="http://www.icpep.org/wp-content/uploads/2009/10/translate_logo.gif" alt="translate_logo" width="205" height="40" /></p>
<p style="text-align: justify;">Google has provided web developers <span>foreign language translation api. </span><span>Web content translation is not a problem anymore, with google&#8217;s Google Translate, research from different countries is now made possible. </span></p>
<p style="text-align: justify;"><span>This is a big help especially for researchers on the net, we can now easily understand web contents and even text from outside sources which also serves as a document translation services.  Google allows us to copy and  paste phrases, sentences and paragraphs from outside sources  to their google translate and by selecting the language you desire we can now get translation to it.</span></p>
<p style="text-align: justify;">But how do we add google translate on our website?  I have provided 3 different ways on how to achieve google translate on your website.  The easiest is for wordpress users, you can add a <span>web content translation by downloading the plugin <a title="Global Translator" href="http://wordpress.org/extend/plugins/global-translator/">Global Translator </a> </span>.  Follow the steps carefully and you can provide your users translation of different languages according to your choice as set on the administration panel.</p>
<p>The second way of adding a web content translation software by google is by adding a snippet of  codes which they have provided on their site<a href="http://translate.google.com/translate_tools"> Google Translate</a> or just copy and paste the code below and add it on your website.  This is also the code I used in this blog.<span id="more-881"></span></p>
<div style="border:1px solid #00B3F0; background-color: #F4F4F4;padding: 5px;">&lt;div id=&#8221;google_translate_element&#8221;&gt;&lt;/div&gt;&lt;script&gt;</p>
<p>function googleTranslateElementInit() {</p>
<p>new google.translate.TranslateElement({</p>
<p>pageLanguage: &#8216;en&#8217;</p>
<p>}, &#8216;google_translate_element&#8217;);</p>
<p>}</p>
<p>&lt;/script&gt;&lt;script src=&#8221;http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit&#8221;&gt;&lt;/script&gt;</p></div>
<p>If you want to have your own design and style you can still add translation to your site below is an example of the code.  Make sure you have images of the flags as what I used in the code.</p>
<div style="border:1px solid #00B3F0; background-color: #F4F4F4;padding:5px;">&lt;form action=&#8221;http://www.google.com/translate&#8221; &gt;</p>
<p>&lt;script language=&#8221;JavaScript&#8221;&gt;</p>
<p>&lt;!&#8211;</p>
<p>document.write (&#8220;&lt;input name=u value=&#8221;+location.href+&#8221; type=hidden&gt;&#8221;)</p>
<p>// &#8211;&gt;</p>
<p>&lt;/script&gt;</p>
<p>&lt;table width=&#8221;185&#8243; height=&#8221;100%&#8221; align=&#8221;right&#8221; style=&#8221;margin-right:5px;&#8221;&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td colspan=&#8221;5&#8243; style=&#8221;background:#C9E2FF;color:#000099;padding:5px; border:1px solid #ACC5EF;&#8221;&gt;&lt;span style=&#8221;font-size:10px; &#8220;&gt;&lt;b&gt;Click flag to change language&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;</p>
<p>&lt;input name=&#8221;hl&#8221; value=&#8221;en&#8221; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;ie&#8221; value=&#8221;UTF8&#8243; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;langpair&#8221; value=&#8221;" type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;langpair&#8221; value=&#8221;en|fr&#8221; title=&#8221;French&#8221; src= &#8220;images/flags/french.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221;  type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|ko&#8221; title=&#8221;Korean&#8221; src= &#8220;images/flags/korean.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221;  type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|da&#8221; title=&#8221;Danish&#8221; src= &#8220;images/flags/denmark.png&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|cy&#8221; title=&#8221;Welsh&#8221; src= &#8220;images/flags/welsh.gif&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221;  type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|zh-CN&#8221; title=&#8221;Chinese Simplified&#8221; src= &#8220;images/flags/chinese.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|de&#8221; title=&#8221;German&#8221; src= &#8220;images/flags/german.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|it&#8221; title=&#8221;Italian&#8221; src= &#8220;images/flags/italian.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|sl&#8221; title=&#8221;Slovenian&#8221; src= &#8220;images/flags/slovenian.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|ru&#8221; title=&#8221;Russian&#8221; src= &#8220;images/flags/russia.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221;  type=&#8221;image&#8221; &gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|pt&#8221; title=&#8221;Portuguese&#8221; src= &#8220;images/flags/pt.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|es&#8221; title=&#8221;Spanish&#8221; src= &#8220;images/flags/spanish.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair&#8221; value=&#8221;en|ja&#8221; title=&#8221;Japanese&#8221; src= &#8220;images/flags/japanese.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;</p>
<p>&lt;input name=&#8221;langpair&#8221; value=&#8221;en|cs&#8221; title=&#8221;Czech&#8221; src= &#8220;images/flags/czech.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;</p>
<p>&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair2&#8243; value=&#8221;en|no&#8221; title=&#8221;Norwegian&#8221; src= &#8220;images/flags/norwegian.jpg&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;td align=&#8221;center&#8221;&gt;&lt;input name=&#8221;langpair2&#8243; value=&#8221;en|ar&#8221; title=&#8221;Arabic&#8221; src= &#8220;images/flags/arabic.gif&#8221; onClick=&#8221;this.form.langpair.value=this.value&#8221; type=&#8221;image&#8221; /&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;/table&gt;</p>
<p>&lt;/form&gt;</p></div>
<p>An example of the snippet can be found in this <a href="http://rstrading.com">link</a>.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<h3 class="r"><a class="l" onmousedown="return clk(this.href,'','','res','1','','0CAkQFjAA')" href="http://www.translate.google.com/translate_t"><em> </em><em>Google Translate</em></a></h3>
</div>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Translation Services" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Translation+Services" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/translation-services/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Code Igniter Query</title>
		<link>http://www.icpep.org/code-igniter-query/</link>
		<comments>http://www.icpep.org/code-igniter-query/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 06:36:53 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=869</guid>
		<description><![CDATA[Code Igniter is one of the best PHP framework available today.  It is free to download and user guide can be found together with the package. In Code Igniter the class that has the database queries or the methods that deals with getting the data on the database is placed inside the MODEL folder.  Just [...]]]></description>
			<content:encoded><![CDATA[<p align="center">
<img src="http://www.icpep.org/wp-content/uploads/2009/10/php-code.jpg" alt="php code" title="php code" width="360" height="288" class="alignnone size-full wp-image-875" />
</p>
<p><a href="http://www.icpep.org/code-igniter-installation-and-first-run/">Code Igniter</a> is one of the best PHP framework available today.  It is free to download and user guide can be found together with the package.</p>
<p>In Code Igniter the class that has the database queries or the methods that deals with getting the data on the database is placed inside the MODEL folder.  Just remember the &#8220;D&#8221; which tells us that Database methods are placed in this folder as what Jeffrey Way said in his tutorials.</p>
<p>Here are different Methods to query the database which is based in <a href="http://net.tutsplus.com">Nettuts+</a> tutorials.</p>
<p>Inside my Model folder I created a file Mydb.php, so the name of my class should be the same as the filename I created.<br />
<span id="more-869"></span></p>
<pre>
< ?php
class Mydb extends Model {
	function getData() {
		$this->db->select('title,content'); #where title and content are fields
		$sql = $this->db->get('data');  #data is a database table
		if($sql->num_rows() > 0) {
			foreach($sql->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
        }
}
?>
</pre>
<p>In this method the line <em>$this->db->select(&#8216;title,content&#8217;);</em> is using code igniter &#8220;active records&#8221; where I stated the fields I need but if you want to get all the data just remove this line.  The line <em>$sql = $this->db->get(&#8216;data&#8217;);</em> tells the name of the table where I want to get the fields title and content.  To make sure I have something to work on the line <em>$sql->num_rows() > 0</em> is placed and the data is placed inside the array $data[].</p>
<p>To be more specific in using code igniter active records,</p>
<pre>
< ?php
class Mydb extends Model {
	function getData() {
		$this->db->select('title,content');
		$this->db->from('data');
		$this->db->where('id',1);
		$sql = $this->db->get();
		if($sql->num_rows() > 0) {
			foreach($sql->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
        }
}
?>
</pre>
<p>Another way of querying is:</p>
<pre>
< ?php
class Mydb extends Model {
	function getData() {
		$sql = $this->db->query('SELECT * FROM data');
		if($sql->num_rows() > 0) {
			foreach($sql->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
	}
}
?>
</pre>
<p>The line<em> $sql = $this->db->query(&#8216;SELECT * FROM data&#8217;);</em> is simply putting the query inside the predefined method in Code Igniter $this->db->query(&#8216;[query]&#8216;).  Still the data returned is an array.</p>
<p>To query with a user input,</p>
<pre>
< ?php
class Mydb extends Model {
	function getData() {
		$sql = "select * from data where id=?";
		$val = $this->db->query($sql, 2);
		if($val->num_rows() > 0) {
			foreach($val->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
	}
}
?>
</pre>
<p>The line <em>$sql = &#8220;select * from data where id=?&#8221;;</em> is our database query where ? is any value passed to it.  The line <em>$val = $this->db->query($sql, 2);</em> is where we execute our query and the value passed to &#8220;?&#8221; is 2. But what if we have more than 1 condition in our query,</p>
<pre>
< ?php
class Mydb extends Model {
	function getData() {
		$sql = "select * from data where id=? and author = ?";
		$val = $this->db->query($sql, array(1, 'Allan'));
		if($val->num_rows() > 0) {
			foreach($val->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
	}
}
?>
</pre>
<p>If we have more than one condition in our query we just use an array stating the value for our conditions.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Code Igniter Query" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Code+Igniter+Query" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/code-igniter-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Object Oriented PHP Samples</title>
		<link>http://www.icpep.org/object-oriented-php-samples/</link>
		<comments>http://www.icpep.org/object-oriented-php-samples/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 11:00:43 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=760</guid>
		<description><![CDATA[PHP is one of the mostly used language on the net. Why is it preferred by most web developers? Well, to give a brief reason why I love PHP most and why it is widely used I am sure of and few of the reasons why I love PHP: It is free, easy to use, [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">PHP is one of the mostly used language on the net.  Why is it preferred by most web developers? Well, to give a brief reason why I love PHP most and why it is widely used I am sure of and few of the reasons why I love PHP:  It is free, easy to use, secure and extremely fast.  PHP before and today have a very big difference since PHP today is on Object Oriented approach though some other ways can still be used but the best thing is that in PHP&#8217;s handling of objects has been completely rewritten, allowing for better performance and more features. Using Object Oriented PHP is a lot way more easier and easier to trace codes rather that putting all together the codes in on PHP file.
</p>
<p>
To have a better look on which is easier to use here is one simple Object Oriented PHP sample:
</p>
<p><pre>
< ?php
$x = 1000;
$y = 2000;
$z = $x + $y;
echo $z;
?>
</pre>
</p>
<p>Before, programming is done this way and it really is a very big pain especially when the same operation is needed on another PHP file.  So I need to re-declare again the values and the operation needed in order to achieve the same result.  Compare the big difference between the two:<span id="more-760"></span></p>
<pre>
< ?php
class operation{
  function add($x,$y){
    $z = $x + $y;
       return $z;
  }
}
$op = new operation();
echo $op->add(5,7);
?>
</pre>
<p align="justify">
Easy right? So every now and then all I need to do is include the file which contains the class and the functions.  For example if we name the file as class.operation.php and we want to use the functions in that class all we need.  This will play a very big difference to all the programmers out who wanted to develop web based software and gain some extra income.
</p>
<p align="justify">
Anyway speaking of programming contest, I saw this site while I was surfing on the net searching for extra income.  Well I got lucky when I came across this site that gives $1O,OOO for a &#8220;Super Sexy&#8221; Mortgage Calculator.  I will just grab this chance to share to all the programmers to join this <a href="http://www.mortgageloanplace.com/mortgage-calculator.php">mortgage calculator contest</a> in the <a href="http://www.mortgageloanplace.com/">Mortgage Loan Place</a>.  What is in this calculator that makes it Super Sexy?  Each mortgage calculator should contain a minimum amount of functionality. Mortgage calculators traditionally compute the value of a monthly payment based on principal, interest, taxes and insurance. To have a clearer view of what the contest is all about you can visit their site on the link given above.  This is also not a problem if you don&#8217;t know how to create one, all you need to do is refer them and gain $1000.  Easy money, isn&#8217;t it?  </p></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="allajosephcagadas@gmail.com" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Can You Buy Me a Beer? for Object Oriented PHP Samples" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.icpep.org/wp-content/plugins/buy-me-beer/icon_beer.gif" align="left" alt="Buy Me a Beer" title="Buy Me a Beer" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=allajosephcagadas@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=&amp;item_name=Can+You+Buy+Me+a+Beer?+for+Object+Oriented+PHP+Samples" target="paypal">Did find the post very useful? Maybe you want to buy me a glass of beer!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/object-oriented-php-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
