<?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; PHP</title>
	<atom:link href="http://www.icpep.org/category/programming/php-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icpep.org</link>
	<description>Just another techie stuff</description>
	<lastBuildDate>Wed, 01 Feb 2012 23:59:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Setting Up a MemCached Server</title>
		<link>http://www.icpep.org/setting-up-a-memcached-server/</link>
		<comments>http://www.icpep.org/setting-up-a-memcached-server/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 09:47:34 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows Hacks]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1555</guid>
		<description><![CDATA[image from www.memcached.org Based on their official website memcached is defined as: Free &#038; open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://www.icpep.org/wp-content/uploads/2012/01/memcached_banner75-300x55.jpg" alt="memcached" title="memcached" width="300" height="55" class="aligncenter size-medium wp-image-1556" /><br /><center><em>image from www.memcached.org</em></center></p>
<p align="justify">Based on their official website <a href="http://memcached.org/" title="MemCached" target="_blank">memcached</a> is defined as:</p>
<blockquote><p>Free &#038; open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.</p>
<p>Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.</p>
<p>Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.</p></blockquote>
<p>&mdash; memcached.org</p>
<h2 style="text-shadow:1px 0px 1px #000;font-weight:bolder;"><u>MemCached Server</u></h2>
<p align="justify">This is how I installed(<em>a simple installation</em>) my memcached server that can be accessed by a webserver on our local area network.  The server is running Ubuntu as its operating system.  <span id="highlight">Caution: The version on ubuntu&#8217;s repository could not be the latest version.  Refer to memcached&#8217;s website for the latest version.  If you want to install the latest version from the source you can refer to memcached&#8217;s <a href="http://code.google.com/p/memcached/wiki/NewInstallFromSource" title="Memcached's wiki page" target="_blank">wiki</a> page</span></p>
<p align="justify">Open synaptic package manager and install <span id="highlight">memcached</span> and <span id="highlight">php5-memcached</span>.  After the installation restart the webserver using the command:</p>
<div id="code">sudo apache2ctl restart</div>
</p>
<p>Start memcached by using the command:</p>
<p align="justify"><div id="code">/etc/init.d/memcached start</div></p>
<p>By default memcached is running on port <span id="highlight">11211</span> and is accessible by the machine with IP 127.0.0.1 which is the machine&#8217;s local IP address with <span id="highlight">64MB</span> memory allocation</p>
<p align="justify">To try if memcached is working use this simple PHP code</p>
<pre class="crayon-plain-tag"><code>&lt; ?php
$m = new Memcached();
$m-&gt;addServer('localhost', 11211);

$m-&gt;set('int', 99);
$m-&gt;set('string', 'a simple string');
$m-&gt;set('array', array(11, 12));
$m-&gt;set('object', new stdclass, time() + 300);

var_dump($m-&gt;get('int'));
var_dump($m-&gt;get('string'));
var_dump($m-&gt;get('array'));
var_dump($m-&gt;get('object'));
?&gt;</code></pre>
<p align="justify">Open the script on the browser.  Try opening the cli and telnet to memcached using the command:</p>
<p><div id="code">telnet 127.0.0.1 11211</div></p>
<p>The image below shows how the cli would look like after the command</p>
<p align="center"><img src="http://www.icpep.org/wp-content/uploads/2012/01/telnet-300x70.png" alt="telnet to memcached" title="telnet to memcached" width="300" height="70" class="aligncenter size-medium wp-image-1557" /></p>
<p align="justify">Check memcached&#8217;s status by using the command</p>
<div id="code">
stats
</div>
</p>
<p>We can get a cached value using the command:</p>
<p><div id="code">get string</div></p>
<p>It should return <span id="highlight">&#8220;a simple string&#8221;</span> as assigned on the script.</p>
<p>To explore more, commands can be seen on this page <a href="http://lzone.de/articles/memcached.htm" target="_blank"><em>http://lzone.de/articles/memcached.htm</em></a></p>
<p align="justify">To allow another machine (<em>local web server</em>) to store data on the memcached server we need to edit the configuration file using the command:</p>
<p><div id="code">
sudo nano /etc/memcached.conf
</div></p>
<p align="justify">In my case I changed the allotted memory to 256MB and allowed IP of 191.168.1.254 which is our windows webserver as seen on the image below:</p>
<p align="center"><a href="http://www.icpep.org/wp-content/uploads/2012/01/Screenshot-2.png" target="_blank"><img src="http://www.icpep.org/wp-content/uploads/2012/01/Screenshot-2-300x180.png" alt="memcached configuration" title="memcached configuration" width="300" height="180" class="aligncenter size-medium wp-image-1558" /></a></p>
<p>After the configuration I restarted memcached using the command:</p>
<p><div id="code">sudo /etc/init.d/memcached restart</div></p>
<h2 style="text-shadow:1px 0px 1px #000;font-weight:bolder;"><u>The Webserver (XAMPP)</u></h2>
<p align="justify">To quickly test the memcached server I used xampp portable version which can be downloaded on their official website <em>www.apachefriends.org</em>.</p>
<p align="justify">As stated earlier the webserver is already allowed to use the memcached server.  As an information memcached is a daemon which runs like the mysql server, so we need PHP to connect to the memcached server.</p>
<p align="justify"><ol>
<li>To start, download memcached on <a href="http://code.jellycan.com/memcached/" title="memcached windows " target="_blank">code.jellycan.com/memcached</a> which is win32 binary.
</li>
<li>After downloading extract the file (<em>recommended: C:\memcached</em>).  You should have the file <em>memcached.exe</em></li>
<li>
We can install memcached as a service on the command line using the command:</p>
<div id="code">C:\memcached\memcached.exe -d install</div>
</li>
<li>
Start memcached using the command:</p>
<div id="code">C:\memcached\memcached.exe -d start</div>
</li>
<li>
After running memcached we need to tie it with PHP using the <span id="highlight">php_memcached.dll</span>.  You should have this file on your PHP&#8217;s ext folder, if not download the file at these links <a href="http://downloads.php.net/pierre/" title="php_memcached.dll" target="_blank">http://downloads.php.net/pierre/</a>, <a href="http://www.pureformsolutions.com/pureform.wordpress.com/2008/06/17/php_memcache.dll" target="_blank">http://www.pureformsolutions.com/pureform.wordpress.com/2008/06/17/php_memcache.dll</a> or on our server: <a class='wpdm-popup' rel='colorbox' title='php_memcached.dll' href='http://www.icpep.org/?download=4' style="background:url('http://www.icpep.org/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;">php_memcached.dll.rar</a>
</li>
<li>
enable the use of php_memcached.dll by editing your php.ini and uncomment the line <span id="highlight">extension=php_memcache.dll</span> if it does not exist add this line.  After editing the file restart the webserver.
</li>
</ol>
<p>You can access the data on the memcached server by using the code below:</p>
<pre class="crayon-plain-tag"><code>&lt; ?php
        $memcache = new Memcache();
        if(!$memcache-&gt;connect('191.168.1.7', 11211))
                die(&quot;Couldn't connect to memcached!&quot;);

        $key=&quot;string&quot;;

        $result = $memcache-&gt;get($key);

        if($result)
        {
                echo &quot;$key is $result&quot;;
        }
        else
        {
            echo 'There is no data saved named '. $key;
        }
?&gt;</code></pre><p>
<p>You should have an output of <span id="highlight">&#8220;a simple string&#8221;</span>.  I hope this helped you set up the server.  Happy coding!</p>
<p>Sources:</p>
<p>http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/</p>
<p>http://memcached.org</p>
<p>http://blogs.oracle.com/oswald/entry/cache_cache_cache_part_1</p>
<style type="text/css">li{text-align:justify;}</style>
<div id="seo_alrp_related"><h2>Posts Related to Setting Up a MemCached Server</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/fixing-apaches-error-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-in-ubuntu/" rel="bookmark">Fixing Apache&#8217;s Error: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName in Ubuntu</a></h3><p>One of the server I am using is running ubuntu. I am installing memcached on the server and every time I restart the web server ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/smb-swat-on-centos-5/" rel="bookmark">SMB Swat on CentOS 5</a></h3><p>&nbsp; Simple howto's when SWAT is not available after you install CentOS.  To start with here are some cli commands to use, [root@goldmine ~]# yum ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/mysql-reset-root-password/" rel="bookmark">MySQL Reset Root Password</a></h3><p>My friend forgot his mysql password and the database needs to be accessed by the root user.  My friend is running MySQL 5.1 and as ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/use-gmail-account-to-relay-email-from-php-mail-function/" rel="bookmark">Use Gmail Account To Relay Email From PHP mail Function</a></h3><p>One of the things I find hard in developing a web application is using a library for sending email such as PHPMailer. I find it ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/code-igniter-installation-and-first-run/" rel="bookmark">Code Igniter Installation and First Run</a></h3><p>Code Igniter is an PHP Application Development Framework - a toolkit for PHP developers. The main goal of Code Igniter is to enable developers to ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/setting-up-a-memcached-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Gmail Account To Relay Email From PHP mail Function</title>
		<link>http://www.icpep.org/use-gmail-account-to-relay-email-from-php-mail-function/</link>
		<comments>http://www.icpep.org/use-gmail-account-to-relay-email-from-php-mail-function/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 14:53:41 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux How To's]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1484</guid>
		<description><![CDATA[One of the things I find hard in developing a web application is using a library for sending email such as PHPMailer. I find it hard when used to send emails. Another thing I find hard is when sending emails in a localhost webserver. It would also cost me more and would take much time in setting up my own mail server. PHP&#8217;s mail function is also very useless in such testing ground. If you are using a gmail account [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://www.icpep.org/wp-content/uploads/2011/12/996862_internet_at_home_2.jpg" alt="Localhost Mail" title="Localhost Mail" width="300" height="300" class="aligncenter size-full wp-image-1485" /></p>
<p align="justify">One of the things I find hard in developing a web application is using a library for sending email such as PHPMailer.  I find it hard when used to send emails.  Another thing I find hard is when sending emails in a localhost webserver.  It would also cost me more and would take much time in setting up my own mail server.  PHP&#8217;s mail function is also very useless in such testing ground.</p>
<p align="justify">If you are using a gmail account and want to use PHP&#8217;s mail function in your local webserver, here is a better way to relay an email to gmail. I am using backtrack 5 Gnome and the steps will also work for debian based distros. Follow the steps below,</p>
<p>Install ssmtp,</p>
<div id="code">
$ sudo apt-get update &#038;&#038; apt-get install ssmtp
</div>
<p align="justify">After installing ssmtp, open the configuration file.</p>
<div id="code">$ sudo nano /etc/ssmtp/ssmtp.conf</div>
<p>Append the configuration at the bottom</p>
<div id="code">
AuthUser=icpep.org@gmail.com<br />
AuthPass=myPassword<br />
FromLineOverride=YES<br />
mailhub=smtp.gmail.com:587<br />
UseSTARTTLS=YES
</div>
<p>After the changes, you can now use PHP&#8217;s mail function</p>
<pre class="crayon-plain-tag"><code>&lt; ?php
$message = &quot;This is a test&quot;;
$message = wordwrap($message, 70);
mail('icpep.org@gmail.com', 'My Subject', $message);
?&gt;</code></pre>
<div id="seo_alrp_related"><h2>Posts Related to Use Gmail Account To Relay Email From PHP mail Function</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/4-thunderbird-add-ons/" rel="bookmark">4 Thunderbird Add-ons</a></h3><p>I am a great fan and a user of mozilla thunderbird. I have used different mail clients like microsoft outlook, opera mail, zimbra mail client, ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/phpmailer/" rel="bookmark">PHPMailer</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/pldts-port-25-smtp/" rel="bookmark">PLDT&#8217;s Port 25 (SMTP)</a></h3><p>Today, a friend and a colleague of mine called me and questioned me why she can't send emails using her mail client which is Incredimail ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/take-a-peek/" rel="bookmark">Peek Gadget</a></h3><p>What is the peek gadget?  Is it like just any ordinary gadgets?  Peek is the only gadget that is solely devoted to check emails.  Peek ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/thunderbird-to-outlook/" rel="bookmark">Thunderbird To Outlook</a></h3><p>I have successfully exported Thunderbird email files on ms outlook 2007 on a Windows XP platform which can also be done in windows vista and windows 7 platform. ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/use-gmail-account-to-relay-email-from-php-mail-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDO Database Extensions Error</title>
		<link>http://www.icpep.org/pdo-database-extensions-error/</link>
		<comments>http://www.icpep.org/pdo-database-extensions-error/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 10:45:19 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[php pdo mysql]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1415</guid>
		<description><![CDATA[&#160; &#160; I installed Apache, MySQL and PHP on windows 7.  I tried to install drupal version 7.9 and went through an error as shown in the image below: The error &#8220;Your web server does not appear to support any common PDO database extensions.&#8221; can be fixed by following these steps: Open your php.ini file Around line 966 uncomment the line &#8220;extension=php_pdo_mysql.dll&#8221; Make sure you have php_pdo_mysql.dll on your ext folder or download it here php_pdo_mysql Restart Apache and you can [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img class="size-full wp-image-1416 aligncenter" title="Drupal Logo" src="http://www.icpep.org/wp-content/uploads/2011/11/logo.png" alt="Drupal Logo" width="88" height="100" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I installed Apache, MySQL and PHP on windows 7.  I tried to install drupal version 7.9 and went through an error as shown in the image below:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1417" title="drupal pdo error" src="http://www.icpep.org/wp-content/uploads/2011/11/drupal-pdo-error.jpg" alt="drupal pdo error" width="531" height="316" /></p>
<p style="text-align: justify;">The error &#8220;<em><span style="color: #ff0000;">Your web server does not appear to support any common PDO database extensions.</span></em>&#8221; can be fixed by following these steps:</p>
<ol>
<li>Open your <em>php.ini</em> file</li>
<li>Around line 966 uncomment the line &#8220;extension=php_pdo_mysql.dll&#8221;</li>
<li>Make sure you have php_pdo_mysql.dll on your ext folder or download it here <a class='wpdm-popup' rel='colorbox' title='php_pdo_mysql' href='http://www.icpep.org/?download=3' style="background:url('http://www.icpep.org/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;">php_pdo_mysql</a></li>
<li>Restart Apache and you can continue with the installation of drupal</li>
</ol>
<div id="seo_alrp_related"><h2>Posts Related to PDO Database Extensions Error</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/php-curl/" rel="bookmark">PHP Curl</a></h3><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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/fixing-apaches-error-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-in-ubuntu/" rel="bookmark">Fixing Apache&#8217;s Error: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName in Ubuntu</a></h3><p>One of the server I am using is running ubuntu. I am installing memcached on the server and every time I restart the web server ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/phpmyadmin-importing-large-data/" rel="bookmark">PHPMyAdmin Importing Large Data</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/slackware-php-gd-error/" rel="bookmark">Slackware PHP GD Error</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/changing-the-owner-of-your-docroot-lamp/" rel="bookmark">Changing the Owner of Your Docroot (LAMP)</a></h3><p>In a LAMP server when you upload files in your htdocs folder by default  the owner of the files is root or the account you ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/pdo-database-extensions-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Virus (ncoyrl.htm, zcv.gif and iframe)</title>
		<link>http://www.icpep.org/website-virus-ncoyrl-htm-zcv-gif-and-iframe/</link>
		<comments>http://www.icpep.org/website-virus-ncoyrl-htm-zcv-gif-and-iframe/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 03:34:37 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1195</guid>
		<description><![CDATA[With millions of websites in search engines we can never be sure that the sites we are visiting are not harmful.  Some search engines like Google helps us detect websites that can cause harm to out computer.  Some search engines do not have this feature which makes us vulnerable to to exploit attacks especially for those that are webmasters.  We must always make sure that we have computer protection such as anti spyware or even the basic antivirus software which can be [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.icpep.org/wp-content/uploads/2010/12/website-virus-1.png"><img class="size-full wp-image-1196 aligncenter" title="website virus" src="http://www.icpep.org/wp-content/uploads/2010/12/website-virus-1.png" alt="website virus" width="452" height="371" /></a></p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.icpep.org/wp-content/uploads/2010/12/website-virus-2.png"><img class="size-full wp-image-1197 aligncenter" title="website virus" src="http://www.icpep.org/wp-content/uploads/2010/12/website-virus-2.png" alt="website virus" width="917" height="22" /></a></p>
<p style="text-align: justify;">With millions of websites in search engines we can never be sure that the sites we are visiting are not harmful.  Some search engines like Google helps us detect websites that can cause harm to out computer.  Some search engines do not have this feature which makes us vulnerable to to exploit attacks especially for those that are webmasters.  We must always make sure that we have computer protection such as anti spyware or even the basic antivirus software which can be downloaded for free on the internet such as avast and avira.<span id="more-1195"></span></p>
<p style="text-align: justify;">Just like the <a href="http://www.icpep.org/telepornnet-redirect/" target="_blank">website virus</a> I found on some of our sites a new one existed and was not even noticed by the webmaster of the site I recently modified.  There was a script injected along the php files, as seen on the images.  I never knew how the virus got into the site, what I saw when I opened the site&#8217;s files via FTP is that there are encrypted codes along the normal pages.  I had the pages scanned and found out that the encrypted codes is a virus.  I removed the lines on the php files and in a short while it was back again.  There I found out that there are 3 files that generates the virus, 1 is the <em>index.php </em>which has the iframe tag as seen on the image, 2nd was the file <em>ncoyrl.htm </em> which has the encrypted javascript codes and lastly a gif image named <em>zcv.gif </em>which also plays a role.</p>
<p style="text-align: justify;">After I deleted the files the website no longer throws a threat warning coming from an antivirus.  We must always make sure that in an online business, security is an issue.  Let a programmer or anybody that is techie enough to check free scripts downloaded online.</p>
<div id="seo_alrp_related"><h2>Posts Related to Website Virus (ncoyrl.htm, zcv.gif and iframe)</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/on-line-virus-scan/" rel="bookmark">Online Virus Scan</a></h3><p>Surfing on the net has been trouble some now a days because there are a lot phishing, fraud, syware, malware, trojans on line. I have ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/telepornnet-redirect/" rel="bookmark">Teleporn.net Redirect</a></h3><p>In the past few days I was solving a problem on a site and the problem was this; The site has an iframe virus, the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/black-hat-seo/" rel="bookmark">black hat Search Engine Optimization</a></h3><p>These black hat SEO techniques usually include one or more of the following characteristics: 1. One who breaks search engine rules. 2. Unethically presents content ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/how-to-check-for-virus-presence/" rel="bookmark">How to check for virus Presence</a></h3><p>There are some tools and procedures that can tell with 99.44 percent accuracy whether your computer has a virus. Here are the actions to take: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/article-submission-websites/" rel="bookmark">Article Submission Websites</a></h3><p>Search Engine Optimization is one of the most difficult thing to do to get your site ranked in the top 3 search engines namely Google, ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/website-virus-ncoyrl-htm-zcv-gif-and-iframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PHP Date Function</title>
		<link>http://www.icpep.org/simple-php-date-function/</link>
		<comments>http://www.icpep.org/simple-php-date-function/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 03:06:41 +0000</pubDate>
		<dc:creator>paparts</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.icpep.org/?p=1149</guid>
		<description><![CDATA[PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display only month and date like &#8216;September 2010&#8242;.  Here is a simple php howto,&#60;div&#62;function curDate()&#160;{&#60;/div&#62; &#60;div id=&#34;_mcePaste&#34;&#62;return date(&#34;Y-m-d&#34;,mktime(date(&#34;h&#34;)+8, date(&#34;i&#34;), date(&#34;s&#34;), date(&#34;m&#34;) &#160;, date(&#34;d&#34;), date(&#34;Y&#34;)));&#60;/div&#62; &#60;div id=&#34;_mcePaste&#34;&#62;}&#60;/div&#62; &#60;div&#62;$now = substr(curDate(),0,7);&#60;/div&#62; &#60;div&#62;echo date(&#34;F Y&#34;, strtotime($now));&#60;/div&#62; &#60;div&#62;?&#38;gt;&#60;/div&#62; The code above will simply output September 2010, a simple code that will surely help you especially when coding PHP from scratch. Posts Related [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.icpep.org/wp-content/uploads/2010/09/month-year-in-php.jpg"><img class="size-full wp-image-1150 aligncenter" title="month year in php" src="http://www.icpep.org/wp-content/uploads/2010/09/month-year-in-php.jpg" alt="" width="429" height="60" /></a></p>
<p>PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display only month and date like &#8216;September 2010&#8242;.  Here is a simple php howto,</p><pre class="crayon-plain-tag"><code>&lt;div&gt;function curDate()&nbsp;{&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;return date(&quot;Y-m-d&quot;,mktime(date(&quot;h&quot;)+8, date(&quot;i&quot;), date(&quot;s&quot;), date(&quot;m&quot;) &nbsp;, date(&quot;d&quot;), date(&quot;Y&quot;)));&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;}&lt;/div&gt;
&lt;div&gt;$now = substr(curDate(),0,7);&lt;/div&gt;
&lt;div&gt;echo date(&quot;F Y&quot;, strtotime($now));&lt;/div&gt;
&lt;div&gt;?&amp;gt;&lt;/div&gt;</code></pre><p>
The code above will simply output September 2010, a simple code that will surely help you especially when coding PHP from scratch.</p>
<div id="seo_alrp_related"><h2>Posts Related to Simple PHP Date Function</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/php-compare-date/" rel="bookmark">PHP Compare Date</a></h3><p>I was creating a program for a library and that is to have a system that will manage the borrowing of books. I was searching ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/nokia-cellphone-hacks/" rel="bookmark">Nokia Cellphone Hacks</a></h3><p>Your Nokia cell phone can be programmed to pick up radar speed traps, when programmed your cell phone picks up the radar and alerts you ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/getting-main-domain/" rel="bookmark">Getting Main Domain</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/how-to-check-for-virus-presence/" rel="bookmark">How to check for virus Presence</a></h3><p>There are some tools and procedures that can tell with 99.44 percent accuracy whether your computer has a virus. Here are the actions to take: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/code-igniter-query/" rel="bookmark">Code Igniter Query</a></h3><p>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 ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/simple-php-date-function/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 version of slackware which is 13.1 on the machine, so all I need to do is have the web server up and running. Our system [...]]]></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>
<div id="seo_alrp_related"><h2>Posts Related to Slackware PHP GD Error</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/maintain-your-ubuntu-machine/" rel="bookmark">Maintain Your Ubuntu Machine</a></h3><p>image from www.qortuba.org These are some of the tools and commands I use to clean up my ubuntu powered laptop. Cleaning Downloaded and Uninstalled Packages ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/slackware-linux-e-book/" rel="bookmark">Slackware Linux E-book</a></h3><p>Knowing a Linux distro is one asset of a network administrator, since then I seemed to be a die hard fan of knowing Linux.  The ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/fixing-apaches-error-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-in-ubuntu/" rel="bookmark">Fixing Apache&#8217;s Error: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName in Ubuntu</a></h3><p>One of the server I am using is running ubuntu. I am installing memcached on the server and every time I restart the web server ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/installing-photoshop-on-ubuntu-10-10/" rel="bookmark">Installing Photoshop on Ubuntu 10.10</a></h3><p>I am now a full Linux user and the distro I used is Ubuntu version 10.10.  Maybe most of my posts will be ubuntu tweaks ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/mysql-duplicate-error/" rel="bookmark">Mysql Duplicate Error</a></h3><p>I created a web application that managers collected links.  The web application was called duplicate checker where premium links collected are being stored in a ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/slackware-php-gd-error/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. {code type=php}&#60;?php function get_base_domain($url)  { $debug = 0; $base_domain = &#8221;; $G_TLD = array( &#8216;biz&#8217;,'com&#8217;,'edu&#8217;,'gov&#8217;,'info&#8217;,'int&#8217;,'mil&#8217;,'name&#8217;,'net&#8217;,'org&#8217;,'aero&#8217;,'asia&#8217;,'cat&#8217;,'coop&#8217;,'jobs&#8217;,'mobi&#8217;,'museum&#8217;, &#8216;pro&#8217;,'tel&#8217;,'travel&#8217;,'arpa&#8217;,'root&#8217;,'berlin&#8217;,'bzh&#8217;,'cym&#8217;,'gal&#8217;,'geo&#8217;,'kid&#8217;,'kids&#8217;,'lat&#8217;,'mail&#8217;,'nyc&#8217;,'post&#8217;,'sco&#8217;,'web&#8217;,'xxx&#8217;, &#8216;nato&#8217;,'example&#8217;,'invalid&#8217;,'localhost&#8217;,'test&#8217;,'bitnet&#8217;,'csnet&#8217;,'ip&#8217;,'local&#8217;,'onion&#8217;,'uucp&#8217;, &#8216;co&#8217; ); // country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain) $C_TLD = array( &#8216;ac&#8217;,'ad&#8217;,'ae&#8217;,'af&#8217;,'ag&#8217;,'ai&#8217;,'al&#8217;,'am&#8217;,'an&#8217;,'ao&#8217;,'aq&#8217;,'ar&#8217;,'as&#8217;,'at&#8217;,'au&#8217;,'aw&#8217;,'ax&#8217;,'az&#8217;, &#8216;ba&#8217;,'bb&#8217;,'bd&#8217;,'be&#8217;,'bf&#8217;,'bg&#8217;,'bh&#8217;,'bi&#8217;,'bj&#8217;,'bm&#8217;,'bn&#8217;,'bo&#8217;,'br&#8217;,'bs&#8217;,'bt&#8217;,'bw&#8217;,'by&#8217;,'bz&#8217;, &#8216;ca&#8217;,'cc&#8217;,'cd&#8217;,'cf&#8217;,'cg&#8217;,'ch&#8217;,'ci&#8217;,'ck&#8217;,'cl&#8217;,'cm&#8217;,'cn&#8217;,'co&#8217;,'cr&#8217;,'cu&#8217;,'cv&#8217;,'cx&#8217;,'cy&#8217;,'cz&#8217;, &#8216;de&#8217;,'dj&#8217;,'dk&#8217;,'dm&#8217;,'do&#8217;,'dz&#8217;,'ec&#8217;,'ee&#8217;,'eg&#8217;,'er&#8217;,'es&#8217;,'et&#8217;,'eu&#8217;,'fi&#8217;,'fj&#8217;,'fk&#8217;,'fm&#8217;,'fo&#8217;, &#8216;fr&#8217;,'ga&#8217;,'gd&#8217;,'ge&#8217;,'gf&#8217;,'gg&#8217;,'gh&#8217;,'gi&#8217;,'gl&#8217;,'gm&#8217;,'gn&#8217;,'gp&#8217;,'gq&#8217;,'gr&#8217;,'gs&#8217;,'gt&#8217;,'gu&#8217;,'gw&#8217;, &#8216;gy&#8217;,'hk&#8217;,'hm&#8217;,'hn&#8217;,'hr&#8217;,'ht&#8217;,'hu&#8217;,'id&#8217;,'ie&#8217;,'il&#8217;,'im&#8217;,'in&#8217;,'io&#8217;,'iq&#8217;,'ir&#8217;,'is&#8217;,'it&#8217;,'je&#8217;, &#8216;jm&#8217;,'jo&#8217;,'jp&#8217;,'ke&#8217;,'kg&#8217;,'kh&#8217;,'ki&#8217;,'km&#8217;,'kn&#8217;,'kr&#8217;,'kw&#8217;,'ky&#8217;,'kz&#8217;,'la&#8217;,'lb&#8217;,'lc&#8217;,'li&#8217;,'lk&#8217;, &#8216;lr&#8217;,'ls&#8217;,'lt&#8217;,'lu&#8217;,'lv&#8217;,'ly&#8217;,'ma&#8217;,'mc&#8217;,'md&#8217;,'mg&#8217;,'mh&#8217;,'mk&#8217;,'ml&#8217;,'mm&#8217;,'mn&#8217;,'mo&#8217;,'mp&#8217;,'mq&#8217;, &#8216;mr&#8217;,'ms&#8217;,'mt&#8217;,'mu&#8217;,'mv&#8217;,'mw&#8217;,'mx&#8217;,'my&#8217;,'mz&#8217;,'na&#8217;,'nc&#8217;,'ne&#8217;,'nf&#8217;,'ng&#8217;,'ni&#8217;,'nl&#8217;,'no&#8217;,'np&#8217;, &#8216;nr&#8217;,'nu&#8217;,'nz&#8217;,'om&#8217;,'pa&#8217;,'pe&#8217;,'pf&#8217;,'pg&#8217;,'ph&#8217;,'pk&#8217;,'pl&#8217;,'pn&#8217;,'pr&#8217;,'ps&#8217;,'pt&#8217;,'pw&#8217;,'py&#8217;,'qa&#8217;, &#8216;re&#8217;,'ro&#8217;,'ru&#8217;,'rw&#8217;,'sa&#8217;,'sb&#8217;,'sc&#8217;,'sd&#8217;,'se&#8217;,'sg&#8217;,'sh&#8217;,'si&#8217;,'sk&#8217;,'sl&#8217;,'sm&#8217;,'sn&#8217;,'sr&#8217;,'st&#8217;, &#8216;sv&#8217;,'sy&#8217;,'sz&#8217;,'tc&#8217;,'td&#8217;,'tf&#8217;,'tg&#8217;,'th&#8217;,'tj&#8217;,'tk&#8217;,'tl&#8217;,'tm&#8217;,'tn&#8217;,'to&#8217;,'tr&#8217;,'tt&#8217;,'tv&#8217;,'tw&#8217;, &#8216;tz&#8217;,'ua&#8217;,'ug&#8217;,'uk&#8217;,'us&#8217;,'uy&#8217;,'uz&#8217;,'va&#8217;,'vc&#8217;,'ve&#8217;,'vg&#8217;,'vi&#8217;,'vn&#8217;,'vu&#8217;,'wf&#8217;,'ws&#8217;,'ye&#8217;,'yu&#8217;, &#8216;za&#8217;,'zm&#8217;,'zw&#8217;,'eh&#8217;,'kp&#8217;,'me&#8217;,'rs&#8217;,'um&#8217;,'bv&#8217;,'gb&#8217;,'pm&#8217;,'sj&#8217;,'so&#8217;,'yt&#8217;,'su&#8217;,'tp&#8217;,'bu&#8217;,'cs&#8217;,'dd&#8217;,'zr&#8217; ); [...]]]></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>
<p>{code type=php}&lt;?php</p>
<p>function get_base_domain($url)  {<br />
$debug = 0;<br />
$base_domain = &#8221;;</p>
<p>$G_TLD = array(<br />
&#8216;biz&#8217;,'com&#8217;,'edu&#8217;,'gov&#8217;,'info&#8217;,'int&#8217;,'mil&#8217;,'name&#8217;,'net&#8217;,'org&#8217;,'aero&#8217;,'asia&#8217;,'cat&#8217;,'coop&#8217;,'jobs&#8217;,'mobi&#8217;,'museum&#8217;,<br />
&#8216;pro&#8217;,'tel&#8217;,'travel&#8217;,'arpa&#8217;,'root&#8217;,'berlin&#8217;,'bzh&#8217;,'cym&#8217;,'gal&#8217;,'geo&#8217;,'kid&#8217;,'kids&#8217;,'lat&#8217;,'mail&#8217;,'nyc&#8217;,'post&#8217;,'sco&#8217;,'web&#8217;,'xxx&#8217;,<br />
&#8216;nato&#8217;,'example&#8217;,'invalid&#8217;,'localhost&#8217;,'test&#8217;,'bitnet&#8217;,'csnet&#8217;,'ip&#8217;,'local&#8217;,'onion&#8217;,'uucp&#8217;,<br />
&#8216;co&#8217; );</p>
<p>// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)<br />
$C_TLD = array(<br />
&#8216;ac&#8217;,'ad&#8217;,'ae&#8217;,'af&#8217;,'ag&#8217;,'ai&#8217;,'al&#8217;,'am&#8217;,'an&#8217;,'ao&#8217;,'aq&#8217;,'ar&#8217;,'as&#8217;,'at&#8217;,'au&#8217;,'aw&#8217;,'ax&#8217;,'az&#8217;,<br />
&#8216;ba&#8217;,'bb&#8217;,'bd&#8217;,'be&#8217;,'bf&#8217;,'bg&#8217;,'bh&#8217;,'bi&#8217;,'bj&#8217;,'bm&#8217;,'bn&#8217;,'bo&#8217;,'br&#8217;,'bs&#8217;,'bt&#8217;,'bw&#8217;,'by&#8217;,'bz&#8217;,<br />
&#8216;ca&#8217;,'cc&#8217;,'cd&#8217;,'cf&#8217;,'cg&#8217;,'ch&#8217;,'ci&#8217;,'ck&#8217;,'cl&#8217;,'cm&#8217;,'cn&#8217;,'co&#8217;,'cr&#8217;,'cu&#8217;,'cv&#8217;,'cx&#8217;,'cy&#8217;,'cz&#8217;,<br />
&#8216;de&#8217;,'dj&#8217;,'dk&#8217;,'dm&#8217;,'do&#8217;,'dz&#8217;,'ec&#8217;,'ee&#8217;,'eg&#8217;,'er&#8217;,'es&#8217;,'et&#8217;,'eu&#8217;,'fi&#8217;,'fj&#8217;,'fk&#8217;,'fm&#8217;,'fo&#8217;,<br />
&#8216;fr&#8217;,'ga&#8217;,'gd&#8217;,'ge&#8217;,'gf&#8217;,'gg&#8217;,'gh&#8217;,'gi&#8217;,'gl&#8217;,'gm&#8217;,'gn&#8217;,'gp&#8217;,'gq&#8217;,'gr&#8217;,'gs&#8217;,'gt&#8217;,'gu&#8217;,'gw&#8217;,<br />
&#8216;gy&#8217;,'hk&#8217;,'hm&#8217;,'hn&#8217;,'hr&#8217;,'ht&#8217;,'hu&#8217;,'id&#8217;,'ie&#8217;,'il&#8217;,'im&#8217;,'in&#8217;,'io&#8217;,'iq&#8217;,'ir&#8217;,'is&#8217;,'it&#8217;,'je&#8217;,<br />
&#8216;jm&#8217;,'jo&#8217;,'jp&#8217;,'ke&#8217;,'kg&#8217;,'kh&#8217;,'ki&#8217;,'km&#8217;,'kn&#8217;,'kr&#8217;,'kw&#8217;,'ky&#8217;,'kz&#8217;,'la&#8217;,'lb&#8217;,'lc&#8217;,'li&#8217;,'lk&#8217;,<br />
&#8216;lr&#8217;,'ls&#8217;,'lt&#8217;,'lu&#8217;,'lv&#8217;,'ly&#8217;,'ma&#8217;,'mc&#8217;,'md&#8217;,'mg&#8217;,'mh&#8217;,'mk&#8217;,'ml&#8217;,'mm&#8217;,'mn&#8217;,'mo&#8217;,'mp&#8217;,'mq&#8217;,<br />
&#8216;mr&#8217;,'ms&#8217;,'mt&#8217;,'mu&#8217;,'mv&#8217;,'mw&#8217;,'mx&#8217;,'my&#8217;,'mz&#8217;,'na&#8217;,'nc&#8217;,'ne&#8217;,'nf&#8217;,'ng&#8217;,'ni&#8217;,'nl&#8217;,'no&#8217;,'np&#8217;,<br />
&#8216;nr&#8217;,'nu&#8217;,'nz&#8217;,'om&#8217;,'pa&#8217;,'pe&#8217;,'pf&#8217;,'pg&#8217;,'ph&#8217;,'pk&#8217;,'pl&#8217;,'pn&#8217;,'pr&#8217;,'ps&#8217;,'pt&#8217;,'pw&#8217;,'py&#8217;,'qa&#8217;,<br />
&#8216;re&#8217;,'ro&#8217;,'ru&#8217;,'rw&#8217;,'sa&#8217;,'sb&#8217;,'sc&#8217;,'sd&#8217;,'se&#8217;,'sg&#8217;,'sh&#8217;,'si&#8217;,'sk&#8217;,'sl&#8217;,'sm&#8217;,'sn&#8217;,'sr&#8217;,'st&#8217;,<br />
&#8216;sv&#8217;,'sy&#8217;,'sz&#8217;,'tc&#8217;,'td&#8217;,'tf&#8217;,'tg&#8217;,'th&#8217;,'tj&#8217;,'tk&#8217;,'tl&#8217;,'tm&#8217;,'tn&#8217;,'to&#8217;,'tr&#8217;,'tt&#8217;,'tv&#8217;,'tw&#8217;,<br />
&#8216;tz&#8217;,'ua&#8217;,'ug&#8217;,'uk&#8217;,'us&#8217;,'uy&#8217;,'uz&#8217;,'va&#8217;,'vc&#8217;,'ve&#8217;,'vg&#8217;,'vi&#8217;,'vn&#8217;,'vu&#8217;,'wf&#8217;,'ws&#8217;,'ye&#8217;,'yu&#8217;,<br />
&#8216;za&#8217;,'zm&#8217;,'zw&#8217;,'eh&#8217;,'kp&#8217;,'me&#8217;,'rs&#8217;,'um&#8217;,'bv&#8217;,'gb&#8217;,'pm&#8217;,'sj&#8217;,'so&#8217;,'yt&#8217;,'su&#8217;,'tp&#8217;,'bu&#8217;,'cs&#8217;,'dd&#8217;,'zr&#8217;<br />
);</p>
<p>// get domain<br />
if ( !$full_domain = get_url_domain($url) ) {<br />
return $base_domain;<br />
}</p>
<p>// now the fun<br />
// break up domain, reverse<br />
$DOMAIN = explode(&#8216;.&#8217;, $full_domain);<br />
if ( $debug ) print_r($DOMAIN);<br />
$DOMAIN = array_reverse($DOMAIN);<br />
if ( $debug ) print_r($DOMAIN);</p>
<p>// first check for ip address<br />
if ( count($DOMAIN) == 4 &amp;&amp; is_numeric($DOMAIN[0]) &amp;&amp; is_numeric($DOMAIN[3]) ) {<br />
return $full_domain;<br />
}</p>
<p>// if only 2 domain parts, that must be our domain<br />
if ( count($DOMAIN) &lt;= 2 ) return $full_domain;</p>
<p>if ( in_array($DOMAIN[0], $C_TLD) &amp;&amp; in_array($DOMAIN[1], $G_TLD) &amp;&amp; $DOMAIN[2] != &#8216;www&#8217; ) {<br />
$full_domain = $DOMAIN[2] . &#8216;.&#8217; . $DOMAIN[1] . &#8216;.&#8217; . $DOMAIN[0];<br />
}<br />
else {<br />
$full_domain = $DOMAIN[1] . &#8216;.&#8217; . $DOMAIN[0];;<br />
}</p>
<p>// did we succeed?<br />
return $full_domain;<br />
}</p>
<p>function get_url_domain($url)  {<br />
$domain = &#8221;;<br />
$_URL = parse_url($url);</p>
<p>// sanity check<br />
if ( empty($_URL) || empty($_URL['host']) )  {<br />
$domain = &#8221;;<br />
}<br />
else {<br />
$domain = $_URL['host'];<br />
}<br />
return $domain;<br />
}<br />
?&gt;{/code}<br />
To test the code we can use the function,<br />
{code type=php}$url  = &#8216;http://www.icpep.org&#8217;;<br />
echo get_base_domain($url) ; // icpep.org{/code}<br />
<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>
<div id="seo_alrp_related"><h2>Posts Related to Getting Main Domain</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/fixing-apaches-error-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-in-ubuntu/" rel="bookmark">Fixing Apache&#8217;s Error: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName in Ubuntu</a></h3><p>One of the server I am using is running ubuntu. I am installing memcached on the server and every time I restart the web server ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/php-displaying-on-the-browser/" rel="bookmark">PHP Displaying On the Browser</a></h3><p>When its your first time to code HTML , the tendency of opening the file is by clicking it twice and yes the expected result ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/code-igniter-query/" rel="bookmark">Code Igniter Query</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/simple-php-date-function/" rel="bookmark">Simple PHP Date Function</a></h3><p>PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/php-compare-date/" rel="bookmark">PHP Compare Date</a></h3><p>I was creating a program for a library and that is to have a system that will manage the borrowing of books. I was searching ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/getting-main-domain/feed/</wfw:commentRss>
		<slash:comments>4</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 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 [...]]]></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>
<div id="seo_alrp_related"><h2>Posts Related to PHPMyAdmin Importing Large Data</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/mysql-duplicate-error/" rel="bookmark">Mysql Duplicate Error</a></h3><p>I created a web application that managers collected links.  The web application was called duplicate checker where premium links collected are being stored in a ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/change-a-string-or-character-in-mysql/" rel="bookmark">Change a String or Character in MySQL</a></h3><p>Knowing the right MySQL statement is the most important part in having thousands of data in your database, one false move and you can't undo ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/code-igniter-query/" rel="bookmark">Code Igniter Query</a></h3><p>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 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/pdo-database-extensions-error/" rel="bookmark">PDO Database Extensions Error</a></h3><p>&nbsp; &nbsp; I installed Apache, MySQL and PHP on windows 7.  I tried to install drupal version 7.9 and went through an error as shown ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/an-error-occurred-executing-the-microsoft-vc-runtime-installer/" rel="bookmark">An Error Occurred Executing the Microsoft VC++ Runtime Installer</a></h3><p>MySQL is proprietary and some developers are now merging to Postgre SQL.  If you are running windows you might come across this error.  I am ...</p></div></li></ul></div>]]></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 on my Laptop using the installers provided on the respective sites. 1.  Install APACHE and PHP (I installed my APACHE on C:\apache and PHP on [...]]]></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>
<div id="seo_alrp_related"><h2>Posts Related to PHP Curl</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/install-and-enable-php5-curl-in-gnome-linux/" rel="bookmark">Install and Enable PHP5 cURL in Gnome-Linux</a></h3><p>PHP5 cURL &nbsp; If you already have a LAMP server and PHP cURL is not yet installed you can open the terminal and use the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/pdo-database-extensions-error/" rel="bookmark">PDO Database Extensions Error</a></h3><p>&nbsp; &nbsp; I installed Apache, MySQL and PHP on windows 7.  I tried to install drupal version 7.9 and went through an error as shown ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/changing-the-owner-of-your-docroot-lamp/" rel="bookmark">Changing the Owner of Your Docroot (LAMP)</a></h3><p>In a LAMP server when you upload files in your htdocs folder by default  the owner of the files is root or the account you ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/apache-allow-htaccess/" rel="bookmark">Apache Allow htaccess</a></h3><p>Most web developers use a "third party" web server which comes in a package such as WAMP or XAMPP resulting to miss configuration of the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/packet-tracer-on-ubuntu/" rel="bookmark">Packet Tracer on Ubuntu amd64 10.10</a></h3><p>Cisco's Packet Tracer is one of my most wanted application when I was using Windows.  When you login to your account in cisco you can ...</p></div></li></ul></div>]]></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 block of IP Address , a web server with PHP installed in it is a perfect set-up for spamming. I have been using this free [...]]]></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;">
<div id="seo_alrp_related"><h2>Posts Related to PHPMailer</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/use-gmail-account-to-relay-email-from-php-mail-function/" rel="bookmark">Use Gmail Account To Relay Email From PHP mail Function</a></h3><p>One of the things I find hard in developing a web application is using a library for sending email such as PHPMailer. I find it ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/take-a-peek/" rel="bookmark">Peek Gadget</a></h3><p>What is the peek gadget?  Is it like just any ordinary gadgets?  Peek is the only gadget that is solely devoted to check emails.  Peek ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/pldts-port-25-smtp/" rel="bookmark">PLDT&#8217;s Port 25 (SMTP)</a></h3><p>Today, a friend and a colleague of mine called me and questioned me why she can't send emails using her mail client which is Incredimail ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/4-thunderbird-add-ons/" rel="bookmark">4 Thunderbird Add-ons</a></h3><p>I am a great fan and a user of mozilla thunderbird. I have used different mail clients like microsoft outlook, opera mail, zimbra mail client, ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.icpep.org/create-gmail-account-in-a-flash/" rel="bookmark">Create Gmail Account in a Flash</a></h3><p>With Jiffy GMail Email Creator Software you are able to better utilize the world’s best email service. For an unlimited amount of reasons, you might ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.icpep.org/phpmailer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

