<?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>Mukesh Chapagain&#039;s Blog &#187; PHP</title>
	<atom:link href="http://blog.chapagain.com.np/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chapagain.com.np</link>
	<description>PHP Magento jQuery SQL Wordpress Joomla Programming &#38; Tutorial</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Windows: How to install and setup XDebug in PHP Eclipse?</title>
		<link>http://blog.chapagain.com.np/windows-how-to-install-and-setup-xdebug-in-php-eclipse/</link>
		<comments>http://blog.chapagain.com.np/windows-how-to-install-and-setup-xdebug-in-php-eclipse/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 16:22:54 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1523</guid>
		<description><![CDATA[PHPEclipse is a PHP development plugin for the Eclipse IDE Framework. And, XDebug is a PHP extension which provides debugging and profiling capabilities. I am using Windows 7 Operating System and WAMP Server. Install XDebug in Windows - Create a php file with the code phpinfo(). - Open the newly created file in a browser. [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images/' rel='bookmark' title='Permanent Link: Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]'>Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]</a></li>
<li><a href='http://blog.chapagain.com.np/php-source-code-encoding-with-ioncube-php-encoder/' rel='bookmark' title='Permanent Link: PHP source code encoding with ionCube PHP Encoder'>PHP source code encoding with ionCube PHP Encoder</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-find-php-version-and-php-ini-file-location-path/' rel='bookmark' title='Permanent Link: How to find php version and php.ini file location path?'>How to find php version and php.ini file location path?</a></li>
<li><a href='http://blog.chapagain.com.np/wordpress-mu-admin-login-problem/' rel='bookmark' title='Permanent Link: WordPress MU: Admin login problem'>WordPress MU: Admin login problem</a></li>
<li><a href='http://blog.chapagain.com.np/magento-setup-multiple-website/' rel='bookmark' title='Permanent Link: Magento: Setup Multiple Website'>Magento: Setup Multiple Website</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>PHPEclipse is a PHP development plugin for the <a href="http://eclipse.org" target="_blank" rel="nofollow">Eclipse IDE Framework</a>. And, <a href="http://xdebug.org/" target="_blank" rel="nofollow">XDebug</a> is a PHP extension which provides debugging and profiling capabilities.</p>
<p>I am using Windows 7 Operating System and WAMP Server.</p>
<p><span id="more-1523"></span></p>
<p><strong>Install XDebug in Windows</strong></p>
<p>- Create a php file with the code <code>phpinfo()</code>.<br />
- Open the newly created file in a browser. This outputs information about PHP&#8217;s configuration.<br />
- Select All (CTRL + A)<br />
- Copy (CTRL + C)<br />
- Open <a href="http://xdebug.org/find-binary.php" target="_blank" rel="nofollow">http://xdebug.org/find-binary.php</a><br />
- Paste in the textarea present in the page of the above link. Note: Do not paste the raw HTML (from view-source).<br />
- Click &#8216;Analyse&#8217; button.</p>
<p>You will get the installation instruction based on your php configuration. I got something like this:-</p>
<p>1. Download <strong>php_xdebug-2.1.2-5.3-vc9-x86_64.dll</strong><br />
2. Move the downloaded file to <strong>c:\wamp\bin\php\php5.3.4\ext</strong><br />
3. Update <strong>C:\wamp\bin\apache\Apache2.2.17\bin\php.ini</strong> and change the line<br />
	<code>zend_extension = c:\wamp\bin\php\php5.3.4\ext\php_xdebug-2.1.2-5.3-vc9-x86_64.dll</code><br />
4. Restart the webserver</p>
<p>- You should also add the following line in <strong>php.ini</strong> file.<br />
	<code>xdebug.remote_enable = 1</code><br />
- Restart the webserver</p>
<p>Now, you have installed XDebug in your Windows OS. You also need to make some configuration settings (adjusting preferences) in PHP Eclipse to make XDebug work in it. I have previously written a post on <a href="http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images" target="_blank">installing and setting up XDebug in PHP Eclipse in Ubuntu Linux</a>. You can follow the steps on PHP Eclipse configuration from that link. It (PHP Eclipse settings) is the same way for both Linux and Windows. </p>
<p><a href="http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images" target="_blank">Click here for the link</a></p>
<p>Hope it helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1523&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images/' rel='bookmark' title='Permanent Link: Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]'>Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]</a></li>
<li><a href='http://blog.chapagain.com.np/php-source-code-encoding-with-ioncube-php-encoder/' rel='bookmark' title='Permanent Link: PHP source code encoding with ionCube PHP Encoder'>PHP source code encoding with ionCube PHP Encoder</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-find-php-version-and-php-ini-file-location-path/' rel='bookmark' title='Permanent Link: How to find php version and php.ini file location path?'>How to find php version and php.ini file location path?</a></li>
<li><a href='http://blog.chapagain.com.np/wordpress-mu-admin-login-problem/' rel='bookmark' title='Permanent Link: WordPress MU: Admin login problem'>WordPress MU: Admin login problem</a></li>
<li><a href='http://blog.chapagain.com.np/magento-setup-multiple-website/' rel='bookmark' title='Permanent Link: Magento: Setup Multiple Website'>Magento: Setup Multiple Website</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/windows-how-to-install-and-setup-xdebug-in-php-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]</title>
		<link>http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images/</link>
		<comments>http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 13:56:47 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1516</guid>
		<description><![CDATA[PHPEclipse is a PHP development plugin for the Eclipse IDE Framework. And, XDebug is a PHP extension which provides debugging and profiling capabilities. I am using Ubuntu Operating System. This article provides a step-by-step guide on installing and setting up XDebug in PHP Eclipse in Ubuntu. Install XDebug in Ubuntu Open terminal and type the [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/ubuntu-linux-change-root-current-user-password/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Change Root &#038; Current User Password'>Ubuntu Linux: Change Root &#038; Current User Password</a></li>
<li><a href='http://blog.chapagain.com.np/ubuntu-linux-get-ram-hard-disk-size-processor-information/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Get RAM, Hard disk size, Processor information'>Ubuntu Linux: Get RAM, Hard disk size, Processor information</a></li>
<li><a href='http://blog.chapagain.com.np/ubuntu-linux-best-screenshot-software-capture-tool/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Best Screenshot Software &#038; Capture Tool'>Ubuntu Linux: Best Screenshot Software &#038; Capture Tool</a></li>
<li><a href='http://blog.chapagain.com.np/apache-virtual-host-and-setting-it-up-on-ubuntu-linux/' rel='bookmark' title='Permanent Link: Apache Virtual Host and Setting it up on Ubuntu Linux'>Apache Virtual Host and Setting it up on Ubuntu Linux</a></li>
<li><a href='http://blog.chapagain.com.np/rabbitvcs-easy-graphical-svn-git-version-control-tool/' rel='bookmark' title='Permanent Link: RabbitVCS: Easy Graphical SVN &#038; GIT version control tool for Linux'>RabbitVCS: Easy Graphical SVN &#038; GIT version control tool for Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>PHPEclipse is a PHP development plugin for the <a href="http://eclipse.org" target="_blank" rel="nofollow">Eclipse IDE Framework</a>. And, <a href="http://xdebug.org/" target="_blank" rel="nofollow">XDebug</a> is a PHP extension which provides debugging and profiling capabilities.</p>
<p>I am using Ubuntu Operating System. This article provides a step-by-step guide on installing and setting up XDebug in PHP Eclipse in Ubuntu.</p>
<p><span id="more-1516"></span></p>
<p><strong>Install XDebug in Ubuntu</strong></p>
<p>Open terminal and type the following command:-</p>
<p><code>sudo apt-get install php5-xdebug</code></p>
<p>This will install XDebug.</p>
<p><strong>Update xdebug.ini file</strong></p>
<p>Type the following command on terminal to open xdebug.ini for edit:-</p>
<p><code>sudo gedit /etc/php5/apache2/conf.d/xdebug.ini</code></p>
<p>Add the following lines in it:-</p>
<blockquote><p>
xdebug.remote_enable=1<br />
xdebug.remote_handler=dbgp<br />
xdebug.remote_mode=req<br />
xdebug.remote_host=127.0.0.1<br />
xdebug.remote_port=9000
</p></blockquote>
<p><strong>Restart Apache</strong></p>
<p>Type any one of the following command on terminal to restart apache:-</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>or,</p>
<p><code>sudo service apache2 restart</code></p>
<p>We have now installed XDebug and made necessary settings in its ini file as well. Now, we will see how to make necessary settings for XDebug in PHP Eclipse.</p>
<p><strong>Eclipse Settings</strong></p>
<p>- Open Eclipse IDE<br />
- Go to <strong>Window -> Preferences</strong><br />
- On left sidebar, click &#8216;Debug&#8217; menu present under &#8216;PHP&#8217; menu (<strong>PHP -> Debug</strong>)<br />
- Click &#8216;<strong>PHP Executables</strong>&#8216; link as highlighted in the figure below.</p>
<p><a href="https://lh5.googleusercontent.com/-qGTB1RSRDXM/Tr_Fi1hOl5I/AAAAAAAAACE/v3ZgJKyxCaI/s912/Screenshot.png" target="_blank" rel="nofollow"><img src="https://lh5.googleusercontent.com/-qGTB1RSRDXM/Tr_Fi1hOl5I/AAAAAAAAACE/v3ZgJKyxCaI/s912/Screenshot.png" alt="PHP Executables" width="580px" /></a></p>
<p>- A new window will popup. Add the following:-</p>
<blockquote><p>
Name = php5<br />
Executable path = /urs/bin/php5<br />
PHP debugger = XDebug<br />
Leave other fields as they are (without any changes).
</p></blockquote>
<p>- Uncheck &#8216;<strong>Break at First Line</strong>&#8216; as shown in the figure below.</p>
<p><a href="https://lh5.googleusercontent.com/-ASRjOyAvA7c/Tr_FlgQnXEI/AAAAAAAAACU/gbe513ZXhBs/s912/Screenshot-3.png" target="_blank" rel="nofollow"><img src="https://lh5.googleusercontent.com/-ASRjOyAvA7c/Tr_FlgQnXEI/AAAAAAAAACU/gbe513ZXhBs/s912/Screenshot-3.png" alt="Break at First Line" width="580px" /></a></p>
<p>- On left sidebar of &#8216;Preferences&#8217;, click &#8216;<strong>PHP Servers</strong>&#8216; menu present under &#8216;PHP&#8217; menu. You will see the following screen.</p>
<p><a href="https://lh3.googleusercontent.com/-624zveSWASM/Tr_Fo8LUZqI/AAAAAAAAACg/ShUQK9uw_TA/s912/Screenshot-5.png" target="_blank" rel="nofollow"><img src="https://lh3.googleusercontent.com/-624zveSWASM/Tr_Fo8LUZqI/AAAAAAAAACg/ShUQK9uw_TA/s912/Screenshot-5.png" alt="PHP Servers" width="580px" /></a></p>
<p>- If you keep your webserver URL as &#8216;<strong>http://localhost</strong>&#8216; then you can skip this step. Otherwise click on the &#8216;Edit&#8217; button. Then, you will see the following screen.</p>
<p><a href="https://lh4.googleusercontent.com/-v_tz5JZFJS4/Tr_FomCuG0I/AAAAAAAAACc/x5Hxgs_OOtQ/s912/Screenshot-6.png" target="_blank" rel="nofollow"><img src="https://lh4.googleusercontent.com/-v_tz5JZFJS4/Tr_FomCuG0I/AAAAAAAAACc/x5Hxgs_OOtQ/s912/Screenshot-6.png" alt="PHP Servers Popup" width="580px" /></a></p>
<p>- I am updating the URL to &#8216;<strong>http://127.0.0.1</strong>&#8216;</p>
<p><a href="https://lh3.googleusercontent.com/-gE7LuP8cMdc/Tr_Fpxmw7mI/AAAAAAAAACo/9a0TUBqh2iU/s912/Screenshot-6b.png" target="_blank" rel="nofollow"><img src="https://lh3.googleusercontent.com/-gE7LuP8cMdc/Tr_Fpxmw7mI/AAAAAAAAACo/9a0TUBqh2iU/s912/Screenshot-6b.png" alt="PHP Servers Update" width="580px" /></a></p>
<p>- On left sidebar of Preferences, there is a search bar on top. Search for &#8216;browser&#8217; and you will see the following screen. Click on &#8216;<strong>Web Browser</strong>&#8216; present under &#8216;General&#8217; menu. And, you will see the following screen. Note that, here you have to select &#8216;Use external web browser&#8217; and then click OK.</p>
<p><a href="https://lh6.googleusercontent.com/-6TGj9y871TA/Tr_FrqgUcUI/AAAAAAAAAC0/yalUASQxTAQ/s912/Screenshot-11.png" target="_blank" rel="nofollow"><img src="https://lh6.googleusercontent.com/-6TGj9y871TA/Tr_FrqgUcUI/AAAAAAAAAC0/yalUASQxTAQ/s912/Screenshot-11.png" alt="Web Browser" width="580px" /></a></p>
<p>- On PHP Eclipse, under menu bar, you will see the following debug icon. </p>
<p><img src="https://lh4.googleusercontent.com/-eEHPohCJOuU/Tr_Fd8KF2LI/AAAAAAAAAB8/265dkgiiP28/s462/debug-conf.png" alt="Debug Icon" /></p>
<p>- Click on the debug icon and you will see a dropdown menu. Click &#8216;<strong>Debug Configurations</strong>&#8216; menu from it. Then you will see the following screen.</p>
<p><a href="https://lh3.googleusercontent.com/-SQm1rhk2ynA/Tr_FjaFCLRI/AAAAAAAAACI/MTY-WA1o4oY/s912/Screenshot-12b.png" target="_blank" rel="nofollow"><img src="https://lh3.googleusercontent.com/-SQm1rhk2ynA/Tr_FjaFCLRI/AAAAAAAAACI/MTY-WA1o4oY/s912/Screenshot-12b.png" alt="Debug Configurations" width="580px" /></a></p>
<p>- In the figure above, I have already performed some necessary steps. Here are they :-<br />
	- Right click on &#8216;<strong>PHP Web Page</strong>&#8216; and select &#8216;New&#8217;.<br />
	- Name it your new web page debug configuration. Like in the figure below, I have <strong>named </strong>my configuration as &#8216;magento1510&#8242;. On my web root, I have a folder/project named &#8216;magento1510&#8242;. I have given the <strong>File </strong>path to the index file of my project. So, it is &#8216;/magento1510/index.php&#8217;.</p>
<p>- Click &#8216;Apply&#8217;.</p>
<p>All the necessary settings have been completed. Now, you are ready to create breakpoints and start debugging.</p>
<p>Hope it helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1516&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/ubuntu-linux-change-root-current-user-password/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Change Root &#038; Current User Password'>Ubuntu Linux: Change Root &#038; Current User Password</a></li>
<li><a href='http://blog.chapagain.com.np/ubuntu-linux-get-ram-hard-disk-size-processor-information/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Get RAM, Hard disk size, Processor information'>Ubuntu Linux: Get RAM, Hard disk size, Processor information</a></li>
<li><a href='http://blog.chapagain.com.np/ubuntu-linux-best-screenshot-software-capture-tool/' rel='bookmark' title='Permanent Link: Ubuntu Linux: Best Screenshot Software &#038; Capture Tool'>Ubuntu Linux: Best Screenshot Software &#038; Capture Tool</a></li>
<li><a href='http://blog.chapagain.com.np/apache-virtual-host-and-setting-it-up-on-ubuntu-linux/' rel='bookmark' title='Permanent Link: Apache Virtual Host and Setting it up on Ubuntu Linux'>Apache Virtual Host and Setting it up on Ubuntu Linux</a></li>
<li><a href='http://blog.chapagain.com.np/rabbitvcs-easy-graphical-svn-git-version-control-tool/' rel='bookmark' title='Permanent Link: RabbitVCS: Easy Graphical SVN &#038; GIT version control tool for Linux'>RabbitVCS: Easy Graphical SVN &#038; GIT version control tool for Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/ubuntu-linux-how-to-install-and-setup-xdebug-in-php-eclipse-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Easily send email with PHPMailer</title>
		<link>http://blog.chapagain.com.np/php-easily-send-email-with-phpmailer/</link>
		<comments>http://blog.chapagain.com.np/php-easily-send-email-with-phpmailer/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 00:29:56 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1454</guid>
		<description><![CDATA[PHPMailer is a PHP class for PHP that provides a package of functions to send email. It is an efficient way to send e-mail within PHP. The following are some features of PHPMailer:- - Sending HTML email - Sending email with attachments - Sending email to multiple recepients via to, CC, BCC, etc - Supports [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-send-email-easily-using-zend_mail/' rel='bookmark' title='Permanent Link: Magento: Send email easily using Zend_Mail'>Magento: Send email easily using Zend_Mail</a></li>
<li><a href='http://blog.chapagain.com.np/magento-send-transactional-email/' rel='bookmark' title='Permanent Link: Magento: Send Transactional Email'>Magento: Send Transactional Email</a></li>
<li><a href='http://blog.chapagain.com.np/magento-tell-email-a-friend-feature-by-default/' rel='bookmark' title='Permanent Link: Magento: Tell / Email a friend &#8211; Feature by default'>Magento: Tell / Email a friend &#8211; Feature by default</a></li>
<li><a href='http://blog.chapagain.com.np/gmail-trick-use-multiple-email-addresses-for-your-single-gmail-account/' rel='bookmark' title='Permanent Link: Gmail Trick: Use multiple email addresses for your single Gmail account'>Gmail Trick: Use multiple email addresses for your single Gmail account</a></li>
<li><a href='http://blog.chapagain.com.np/google-apps-setup-gmail-for-your-domains-email/' rel='bookmark' title='Permanent Link: Google Apps: Setup Gmail for your Domain&#8217;s Email'>Google Apps: Setup Gmail for your Domain&#8217;s Email</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>PHPMailer is a PHP class for PHP that provides a package of functions to send email. It is an efficient way to send e-mail within PHP. The following are some features of PHPMailer:-</p>
<p>- Sending HTML email<br />
- Sending email with attachments<br />
- Sending email to multiple recepients via to, CC, BCC, etc<br />
- Supports nearly all possiblities to send email: mail(), Sendmail, qmail &#038; direct to SMTP server</p>
<p><span id="more-1454"></span></p>
<h3>Download PHPMailer</h3>
<p><strong><a href="http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php4/" target="_blank" rel="nofollow">For PHP 4</a> | <a href="http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list" target="_blank" rel="nofollow">For PHP 5 and above</a></strong></p>
<h3>Sample Code Example</h3>
<p>Note <strong>isMail()</strong> function in the code. This indicates that email is to be sent through mail() function of php.</p>
<p><strong>Sending email using mail() function</strong></p>
<pre class="brush: php; title: ; notranslate">
require_once('phpmailer/class.phpmailer.php');

$mail = new PHPMailer(); // defaults to using php &quot;mail()&quot;

// this indicates that mail() function is to be used to send email
$mail-&gt;IsMail();

$body = &quot;Test body message&quot;;
$mail-&gt;AddAddress(&quot;yourname@example.com&quot;, &quot;John Doe&quot;);
$mail-&gt;Subject    = &quot;PHPMailer Test Subject via mail(), basic&quot;;
$mail-&gt;MsgHTML($body);

if(!$mail-&gt;Send()) {
  echo &quot;Mailer Error: &quot; . $mail-&gt;ErrorInfo;
} else {
  echo &quot;Message sent!&quot;;
}
</pre>
<p><strong>Sending email using SMTP</strong></p>
<p>Along with using SMTP to send email, other functions are also being used. Like, adding reply-to address and from address. Also, notice that multiple reply-to address and multiple to-address are being added. Attachment function is also being included in the below code. You can add multiple attachment.</p>
<pre class="brush: php; title: ; notranslate">
require_once('phpmailer/class.phpmailer.php');

$mail = new PHPMailer(); // defaults to using php &quot;mail()&quot;

$mail-&gt;IsSMTP();
$mail-&gt;Host = &quot;smtp.example.com&quot;;

/**
 * optional
 * used only when SMTP requires authentication
 * if no authentication required then
 * you can set below as: SMTPAuth = false
 */
$mail-&gt;SMTPAuth = true;
$mail-&gt;Username = 'smtp_username';
$mail-&gt;Password = 'smtp_password';

$mail-&gt;AddReplyTo(&quot;name@yourdomain.com&quot;,&quot;First Last&quot;);
$mail-&gt;AddReplyTo(&quot;name2@yourdomain.com&quot;,&quot;First Last2&quot;);

$mail-&gt;SetFrom('name@yourdomain.com', 'First Last');

$body = &quot;Test body message&quot;;

$mail-&gt;AddAddress(&quot;yourname@example.com&quot;, &quot;John Doe&quot;);
$mail-&gt;AddAddress(&quot;yourname2@example.com&quot;, &quot;John Doe2&quot;);

$mail-&gt;Subject    = &quot;PHPMailer Test Subject via mail(), basic&quot;;
$mail-&gt;MsgHTML($body);

$mail-&gt;AddAttachment(&quot;images/phpmailer.gif&quot;);      // attachment
$mail-&gt;AddAttachment(&quot;images/phpmailer_mini.gif&quot;); // attachment

if(!$mail-&gt;Send()) {
  echo &quot;Mailer Error: &quot; . $mail-&gt;ErrorInfo;
} else {
  echo &quot;Message sent!&quot;;
}
</pre>
<h3>Download PHPMailer</h3>
<p><strong><a href="http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php4/" target="_blank" rel="nofollow">For PHP 4</a> | <a href="http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list" target="_blank" rel="nofollow">For PHP 5 and above</a></strong></p>
<p>Hope it helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1454&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-send-email-easily-using-zend_mail/' rel='bookmark' title='Permanent Link: Magento: Send email easily using Zend_Mail'>Magento: Send email easily using Zend_Mail</a></li>
<li><a href='http://blog.chapagain.com.np/magento-send-transactional-email/' rel='bookmark' title='Permanent Link: Magento: Send Transactional Email'>Magento: Send Transactional Email</a></li>
<li><a href='http://blog.chapagain.com.np/magento-tell-email-a-friend-feature-by-default/' rel='bookmark' title='Permanent Link: Magento: Tell / Email a friend &#8211; Feature by default'>Magento: Tell / Email a friend &#8211; Feature by default</a></li>
<li><a href='http://blog.chapagain.com.np/gmail-trick-use-multiple-email-addresses-for-your-single-gmail-account/' rel='bookmark' title='Permanent Link: Gmail Trick: Use multiple email addresses for your single Gmail account'>Gmail Trick: Use multiple email addresses for your single Gmail account</a></li>
<li><a href='http://blog.chapagain.com.np/google-apps-setup-gmail-for-your-domains-email/' rel='bookmark' title='Permanent Link: Google Apps: Setup Gmail for your Domain&#8217;s Email'>Google Apps: Setup Gmail for your Domain&#8217;s Email</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-easily-send-email-with-phpmailer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Generating Multiple Random String</title>
		<link>http://blog.chapagain.com.np/php-generating-random-string/</link>
		<comments>http://blog.chapagain.com.np/php-generating-random-string/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 18:23:22 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[shuffle]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1480</guid>
		<description><![CDATA[Here is a quick way to generate random strings in PHP. I will be showing how you can generate multiple random strings at once. You can specify the number of letters in the random string generated. You can also specify the total number of words you want to generate. I have used str_shuffle function to [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/random-number-string-generation-in-php/' rel='bookmark' title='Permanent Link: Random number, string generation in PHP'>Random number, string generation in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/generating-random-image/' rel='bookmark' title='Permanent Link: Generating random image'>Generating random image</a></li>
<li><a href='http://blog.chapagain.com.np/php-parse-unparse-string-array/' rel='bookmark' title='Permanent Link: PHP: Parse Unparse String Array'>PHP: Parse Unparse String Array</a></li>
<li><a href='http://blog.chapagain.com.np/magento-set-random-order-in-collection-using-rand/' rel='bookmark' title='Permanent Link: Magento: Set Random Order in Collection using RAND()'>Magento: Set Random Order in Collection using RAND()</a></li>
<li><a href='http://blog.chapagain.com.np/php-simple-and-easy-way-to-format-url-string/' rel='bookmark' title='Permanent Link: PHP: Simple and easy way to format URL string'>PHP: Simple and easy way to format URL string</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here is a quick way to generate random strings in PHP. I will be showing how you can generate multiple random strings at once. You can specify the number of letters in the random string generated. You can also specify the total number of words you want to generate.</p>
<p>I have used <strong>str_shuffle </strong>function to shuffle the string and then <strong>substr </strong>function is used to fetch a portion of the string.</p>
<p><span id="more-1480"></span></p>
<p>Here is the code:-</p>
<pre class="brush: php; title: ; notranslate">
// string from which random strings are generated
$string = 'abcdefghijklmnopqrstuvwxyz';

// result array of random strings
$result = array();

// number of letters in the random string to be generated
$letters = 3;

// total number of word you want to generate
$num = 10;

for ($i=0;$i&lt;$num;$i++) {
	$result[] = substr(str_shuffle($string), 0, $letters);
}

echo &quot;&lt;pre&gt;&quot;; print_r($result); echo &quot;&lt;/pre&gt;&quot;;
</pre>
<p>Hope it helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1480&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/random-number-string-generation-in-php/' rel='bookmark' title='Permanent Link: Random number, string generation in PHP'>Random number, string generation in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/generating-random-image/' rel='bookmark' title='Permanent Link: Generating random image'>Generating random image</a></li>
<li><a href='http://blog.chapagain.com.np/php-parse-unparse-string-array/' rel='bookmark' title='Permanent Link: PHP: Parse Unparse String Array'>PHP: Parse Unparse String Array</a></li>
<li><a href='http://blog.chapagain.com.np/magento-set-random-order-in-collection-using-rand/' rel='bookmark' title='Permanent Link: Magento: Set Random Order in Collection using RAND()'>Magento: Set Random Order in Collection using RAND()</a></li>
<li><a href='http://blog.chapagain.com.np/php-simple-and-easy-way-to-format-url-string/' rel='bookmark' title='Permanent Link: PHP: Simple and easy way to format URL string'>PHP: Simple and easy way to format URL string</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-generating-random-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP MaxMind GeoIP: Get country, city, postal code &amp; much more by IP Address</title>
		<link>http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/</link>
		<comments>http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 00:51:16 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[maxmind]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1287</guid>
		<description><![CDATA[This article describes how to get country and city information using MaxMind&#8216;s GeoIP technology. You provide the IP address of the visitor and GeoIP can give you country and city information for that IP address. About MaxMind Founded in 2002, MaxMind is an industry-leading provider of geolocation and online fraud detection tools. MaxMind provides its [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-get-country-and-region-collection/' rel='bookmark' title='Permanent Link: Magento: Get country and region collection'>Magento: Get country and region collection</a></li>
<li><a href='http://blog.chapagain.com.np/magento-different-shipping-rate-for-different-country-and-region/' rel='bookmark' title='Permanent Link: Magento: Different shipping rate for different country and region'>Magento: Different shipping rate for different country and region</a></li>
<li><a href='http://blog.chapagain.com.np/using-jquery-ajax-populate-selection-list/' rel='bookmark' title='Permanent Link: Using jQuery &#038; AJAX: Populate Selection List'>Using jQuery &#038; AJAX: Populate Selection List</a></li>
<li><a href='http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/' rel='bookmark' title='Permanent Link: PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)'>PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-run-magento-code-in-an-external-website/' rel='bookmark' title='Permanent Link: Magento: How to run Magento code in an external website?'>Magento: How to run Magento code in an external website?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This article describes how to get country and city information using <a href="http://www.maxmind.com" rel="nofollow" target="_blank">MaxMind</a>&#8216;s <a href="http://www.maxmind.com/app/ip-locate" rel="nofollow" target="_blank">GeoIP</a> technology. You provide the IP address of the visitor and GeoIP can give you country and city information for that IP address.</p>
<p><strong>About MaxMind</strong></p>
<p><span id="more-1287"></span></p>
<p>Founded in 2002, MaxMind is an industry-leading provider of geolocation and online fraud detection tools. MaxMind provides its geolocation technology through the GeoIP brand. </p>
<p><strong>What is GeoIP?</strong></p>
<p>GeoIP® is the proprietary technology that drives MaxMind&#8217;s IP geolocation data and services. GeoIP provides businesses with a non-invasive way to determine geographical and other information about their Internet visitors in real-time. When a person visits your website, GeoIP can determine which country, region, city, postal code, and area code the visitor is coming from. Furthermore, GeoIP can provide information such as longitude/latitude, connection speed, ISP, company name, domain name, and whether the IP address is an anonymous proxy or satellite provider.</p>
<p>They have both free and paid service of <a href="http://www.maxmind.com/app/ip-location" rel="nofollow" target="_blank">GeoIP</a>. This article uses the free version of GeoIP.</p>
<p><strong>Get country name and country code by IP address</strong></p>
<p>You need to include two files: <strong>geoip.inc</strong> and <strong>GeoIP.dat</strong></p>
<p><strong>Download</strong>: <a href="http://geolite.maxmind.com/download/geoip/api/php/geoip.inc" rel="nofollow" target="_blank">geoip.inc</a> | <a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" rel="nofollow" target="_blank">GeoIP.dat</a></p>
<pre class="brush: php; title: ; notranslate">
/**
 * Lookup the country by IP Address
 * This will only fetch country code and country name
 */

include(&quot;include/geoip.inc&quot;);

$gi = geoip_open(&quot;include/GeoIP.dat&quot;, GEOIP_STANDARD);

echo &quot;Getting Country Code and Name by IP Address &lt;br /&gt;&lt;br /&gt;&quot;;

$ip = &quot;24.24.24.24&quot;;
echo &quot;IP: &quot;. $ip . &quot;&lt;br /&gt;&quot;;
echo &quot;Country Code: &quot; . geoip_country_code_by_addr($gi, $ip) . &quot;&lt;br /&gt;&quot; .
     &quot;Country Name: &quot; . geoip_country_name_by_addr($gi, $ip) . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;

$ip = &quot;80.24.24.24&quot;;
echo &quot;IP: &quot; . $ip . &quot;&lt;br /&gt;&quot;;
echo &quot;Country Code: &quot; . geoip_country_code_by_addr($gi, $ip) . &quot;&lt;br /&gt;&quot; .
     &quot;Country Name: &quot; . geoip_country_name_by_addr($gi, $ip) . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;

geoip_close($gi);
</pre>
<p><strong>Get Country and City detail by IP address</strong></p>
<p>You can get Country, Region, City name and code, Postal code, Latitude, Longitude, Metro code and Area code by IP address.</p>
<p>You need to include three files: <strong>geoipcity.inc</strong>, <strong>geoipregionvars.php</strong> and <strong>GeoLiteCity.dat</strong></p>
<p><strong>Download</strong>: <a href="http://geolite.maxmind.com/download/geoip/api/php/geoipcity.inc" rel="nofollow" target="_blank">geoipcity.inc</a> | <a href="http://geolite.maxmind.com/download/geoip/api/php/geoipregionvars.php" rel="nofollow" target="_blank">geoipregionvars.inc</a> | <a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" rel="nofollow" target="_blank">GeoLiteCity.dat</a></p>
<pre class="brush: php; title: ; notranslate">
/**
 * Querying against GeoIP/Lite City
 * This will fetch country along with city information
 */ 

include(&quot;include/geoipcity.inc&quot;);
include(&quot;include/geoipregionvars.php&quot;);

$giCity = geoip_open(&quot;include/GeoLiteCity.dat&quot;,GEOIP_STANDARD);

$ip = &quot;12.215.42.19&quot;;
$record = geoip_record_by_addr($giCity, $ip);

echo &quot;Getting Country and City detail by IP Address &lt;br /&gt;&lt;br /&gt;&quot;;

echo &quot;IP: &quot; . $ip . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;

echo &quot;Country Code: &quot; . $record-&gt;country_code .  &quot;&lt;br /&gt;&quot; .
	 &quot;Country Code3: &quot; . $record-&gt;country_code . &quot;&lt;br /&gt;&quot; .
	 &quot;Country Name: &quot; . $record-&gt;country_name . &quot;&lt;br /&gt;&quot; .
	 &quot;Region Code: &quot; . $record-&gt;region . &quot;&lt;br /&gt;&quot; .
	 &quot;Region Name: &quot; . $GEOIP_REGION_NAME[$record-&gt;country_code][$record-&gt;region] . &quot;&lt;br /&gt;&quot; .
	 &quot;City: &quot; . $record-&gt;city . &quot;&lt;br /&gt;&quot; .
	 &quot;Postal Code: &quot; . $record-&gt;postal_code . &quot;&lt;br /&gt;&quot; .
	 &quot;Latitude: &quot; . $record-&gt;latitude . &quot;&lt;br /&gt;&quot; .
	 &quot;Longitude: &quot; . $record-&gt;longitude . &quot;&lt;br /&gt;&quot; .
	 &quot;Metro Code: &quot; . $record-&gt;metro_code . &quot;&lt;br /&gt;&quot; .
	 &quot;Area Code: &quot; . $record-&gt;area_code . &quot;&lt;br /&gt;&quot; ;  

geoip_close($giCity);
</pre>
<p><strong>Get timezone by country and region code</strong></p>
<p>You can get timezone for any country using the country code. You can also use region code for getting region wise timezone as well.</p>
<p>You need to include one file: <strong>timezone.php</strong></p>
<p><strong>Download</strong>: <a href="http://geolite.maxmind.com/download/geoip/api/php/timezone/timezone.php" rel="nofollow" target="_blank">timezone.php</a></p>
<pre class="brush: php; title: ; notranslate">
require(&quot;include/timezone.php&quot;);

echo get_time_zone(&quot;US&quot;,&quot;WV&quot;);
echo &quot;&lt;br /&gt;&quot;;
echo get_time_zone(&quot;NP&quot;,&quot;&quot;);
</pre>
<blockquote><p>You can download the php api with sample code files from: <a href="http://geolite.maxmind.com/download/geoip/api/php/" rel="nofollow" target="_blank">http://geolite.maxmind.com/download/geoip/api/php/</a></p></blockquote>
<p>Cheers &#038; Enjoy!</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1287&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-get-country-and-region-collection/' rel='bookmark' title='Permanent Link: Magento: Get country and region collection'>Magento: Get country and region collection</a></li>
<li><a href='http://blog.chapagain.com.np/magento-different-shipping-rate-for-different-country-and-region/' rel='bookmark' title='Permanent Link: Magento: Different shipping rate for different country and region'>Magento: Different shipping rate for different country and region</a></li>
<li><a href='http://blog.chapagain.com.np/using-jquery-ajax-populate-selection-list/' rel='bookmark' title='Permanent Link: Using jQuery &#038; AJAX: Populate Selection List'>Using jQuery &#038; AJAX: Populate Selection List</a></li>
<li><a href='http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/' rel='bookmark' title='Permanent Link: PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)'>PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-run-magento-code-in-an-external-website/' rel='bookmark' title='Permanent Link: Magento: How to run Magento code in an external website?'>Magento: How to run Magento code in an external website?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP 5.3 &amp; Magento Older Versions: How to use them together?</title>
		<link>http://blog.chapagain.com.np/php-5-3-magento-older-versions-how-to-use-them-together/</link>
		<comments>http://blog.chapagain.com.np/php-5-3-magento-older-versions-how-to-use-them-together/#comments</comments>
		<pubDate>Tue, 24 May 2011 08:22:38 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1350</guid>
		<description><![CDATA[Magento works fine in PHP 5.3 from versions 1.4 and later. But, error is displayed in different pages when we use older versions (prior to 1.4) of Magento in PHP 5.3. This is because some php functions are deprecated in PHP 5.3 and those functions have been used in Magento Older Versions. I tested Magento [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-recoverable-error-argument-1-passed-to-mage_core_model_store-setwebsite-must-be-an-instance-of-mage_core_model_website/' rel='bookmark' title='Permanent Link: Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website'>Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-get-working-site-path-and-directory-name-in-php/' rel='bookmark' title='Permanent Link: How to get working site path and directory name in php?'>How to get working site path and directory name in php?</a></li>
<li><a href='http://blog.chapagain.com.np/magento-solution-to-error-404-not-found-in-admin-login-page/' rel='bookmark' title='Permanent Link: Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page'>Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page</a></li>
<li><a href='http://blog.chapagain.com.np/magento-track-visitors-information/' rel='bookmark' title='Permanent Link: Magento: Track Visitor&#8217;s Information'>Magento: Track Visitor&#8217;s Information</a></li>
<li><a href='http://blog.chapagain.com.np/magento-create-read-delete-cookie/' rel='bookmark' title='Permanent Link: Magento: Create, read, delete cookie'>Magento: Create, read, delete cookie</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Magento works fine in PHP 5.3 from versions 1.4 and later. But, error is displayed in different pages when we use older versions (prior to 1.4) of Magento in PHP 5.3.</p>
<p>This is because some php functions are <a href="http://php.net/manual/en/migration53.deprecated.php" rel="nofollow" target="_blank">deprecated in PHP 5.3</a> and those functions have been used in Magento Older Versions.</p>
<p><span id="more-1350"></span></p>
<p>I tested Magento version 1.3.2.4 in PHP 5.3 and encoutered the following errors. The solution is also posted along with each error:-</p>
<p><strong>FRONTEND SECTION</strong></p>
<blockquote><p>
File: /lib/Varien/Object.php<br />
Line: 484
</p></blockquote>
<p>Change From:</p>
<pre class="brush: php; title: ; notranslate">
public function __toString(array $arrAttributes = array(), $valueSeparator=',')
</pre>
<p>To:</p>
<pre class="brush: php; title: ; notranslate">
public function __invoke(array $arrAttributes = array(), $valueSeparator=',')
</pre>
<blockquote><p>
File: /app/code/core/Mage/Core/Controller/Request/Http.php<br />
Line: 274
</p></blockquote>
<p>Change From:</p>
<pre class="brush: php; title: ; notranslate">
$host = split(':', $_SERVER['HTTP_HOST']);
</pre>
<p>To:</p>
<pre class="brush: php; title: ; notranslate">
$host = explode(':', $_SERVER['HTTP_HOST']);
</pre>
<blockquote><p>
File: /var/www/m1324/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php<br />
Line: 139
</p></blockquote>
<p>Change From: </p>
<pre class="brush: php; title: ; notranslate">
$key.= $taxReq-&gt;__toString(array(), '_');
</pre>
<p>To:</p>
<pre class="brush: php; title: ; notranslate">
$key.= $taxReq-&gt;__invoke(array(), '_');
</pre>
<p><strong>ADMIN SECTION</strong></p>
<blockquote><p>
File: /var/www/m1324/app/code/core/Mage/Admin/Model/User.php<br />
Line: 374
</p></blockquote>
<p>Change From: </p>
<pre class="brush: php; title: ; notranslate">
$nodePath = 'adminhtml/menu/' . join('/children/', split('/', $startupPage)) . '/action';
</pre>
<p>To:</p>
<pre class="brush: php; title: ; notranslate">
$nodePath = 'adminhtml/menu/' . join('/children/', explode('/', $startupPage)) . '/action';
</pre>
<p>Hope this helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1350&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-recoverable-error-argument-1-passed-to-mage_core_model_store-setwebsite-must-be-an-instance-of-mage_core_model_website/' rel='bookmark' title='Permanent Link: Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website'>Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-get-working-site-path-and-directory-name-in-php/' rel='bookmark' title='Permanent Link: How to get working site path and directory name in php?'>How to get working site path and directory name in php?</a></li>
<li><a href='http://blog.chapagain.com.np/magento-solution-to-error-404-not-found-in-admin-login-page/' rel='bookmark' title='Permanent Link: Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page'>Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page</a></li>
<li><a href='http://blog.chapagain.com.np/magento-track-visitors-information/' rel='bookmark' title='Permanent Link: Magento: Track Visitor&#8217;s Information'>Magento: Track Visitor&#8217;s Information</a></li>
<li><a href='http://blog.chapagain.com.np/magento-create-read-delete-cookie/' rel='bookmark' title='Permanent Link: Magento: Create, read, delete cookie'>Magento: Create, read, delete cookie</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-5-3-magento-older-versions-how-to-use-them-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP source code encoding with ionCube PHP Encoder</title>
		<link>http://blog.chapagain.com.np/php-source-code-encoding-with-ioncube-php-encoder/</link>
		<comments>http://blog.chapagain.com.np/php-source-code-encoding-with-ioncube-php-encoder/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 13:35:04 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[ionCube]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1111</guid>
		<description><![CDATA[The ionCube PHP Encoder makes it easy to protect your PHP 4 &#038; 5 source code, including sources using the PHP 5.3 language, from easy observation, theft and change. Encoded files run on a wide range of operating systems such as Linux, Windows, FreeBSD and others. Introduction: http://www.ioncube.com/sa_encoder.php Pricing: http://www.ioncube.com/sa_encoder.php?page=pricing Evaluation version download: http://www.ioncube.com/encoder_eval_download.php Encoding [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/how-to-change-the-source-code-and-modifyparse-a-website/' rel='bookmark' title='Permanent Link: How to change the source code and modify/parse a website?'>How to change the source code and modify/parse a website?</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-get-html-source-code-of-a-website/' rel='bookmark' title='Permanent Link: How to get(view) html source code of a website'>How to get(view) html source code of a website</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-find-php-version-and-php-ini-file-location-path/' rel='bookmark' title='Permanent Link: How to find php version and php.ini file location path?'>How to find php version and php.ini file location path?</a></li>
<li><a href='http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/' rel='bookmark' title='Permanent Link: PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address'>PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address</a></li>
<li><a href='http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/' rel='bookmark' title='Permanent Link: PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)'>PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The <strong><a href="http://www.ioncube.com/" rel="nofollow">ionCube PHP Encoder</a></strong> makes it easy to protect your PHP 4 &#038; 5 source code, including sources using the PHP 5.3 language, from easy observation, theft and change. Encoded files run on a wide range of operating systems such as Linux, Windows, FreeBSD and others.</p>
<p><strong>Introduction</strong>: <a href="http://www.ioncube.com/sa_encoder.php" rel="nofollow">http://www.ioncube.com/sa_encoder.php</a></p>
<p><span id="more-1111"></span></p>
<p><strong>Pricing</strong>: <a href="http://www.ioncube.com/sa_encoder.php?page=pricing" rel="nofollow">http://www.ioncube.com/sa_encoder.php?page=pricing</a></p>
<p><strong>Evaluation version download</strong>: <a href="http://www.ioncube.com/encoder_eval_download.php" rel="nofollow">http://www.ioncube.com/encoder_eval_download.php</a></p>
<p><strong>Encoding PHP source code</strong>:-</p>
<p>- Download ionCube PHP Encoder<br />
- Install the software<br />
- Run the software<br />
- Provide your source and traget directory for the PHP code to be encoded.<br />
- If you are encoding php file, then give the PHP Encoding extension as &#8216;php&#8217;.<br />
- Execute the program.<br />
- The encoded file will be stored in the specified target directory.</p>
<p><strong>Running the Encoded PHP file</strong>:-</p>
<p>For this, you need to have &#8220;<strong><a href="http://www.ioncube.com/loaders.php" rel="nofollow">ionCube Loader</a></strong>&#8220;. ionCube Loader is a PHP extension that works to decode PHP scripts previously encoded by the ionCube PHP Encoder package.</p>
<p>Download latest version of ionCube Loader from here: <a href="http://www.ioncube.com/loaders.php" rel="nofollow">http://www.ioncube.com/loaders.php</a></p>
<p>Install the ionCube Loader PHP extension. The installation instruction is given over here: <a href="http://www.ioncube.com/loader_installation.php" rel="nofollow">http://www.ioncube.com/loader_installation.php</a></p>
<p><strong>ionCube Loader Installation instruction for Windows</strong></p>
<p>I am using Windows OS, WAMP server and PHP version 5.2.6. </p>
<p>- Download zip file from <a href="http://www.ioncube.com/loaders.php" rel="nofollow">http://www.ioncube.com/loaders.php</a> from the row where OS/Platform is <strong>Windows VC9 (x86)</strong> </p>
<blockquote><p>
In this page, you will see different package for different OS. For windows only, there are four versions present (Windows VC6 (x86), Windows VC6 (Non-TS) (x86), Windows VC9 (x86), and Windows VC9 (Non-TS) (x86))</p>
<p>Non-TS means Non Thread Safe.</p>
<p>The difference between VC6 and VC9 for Windows OS is given below:- </p>
<p>VC6 Versions are compiled with the legacy Visual Studio 6 compiler.<br />
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability.
</p></blockquote>
<p>- Extract the zip file</p>
<p>- Copy <strong>loader-wizard.php</strong> to your root directory. In my case it is <strong>C:\wamp\www\</strong></p>
<p>- My PHP version is 5.2.6. So, I will copy <strong>ioncube_loader_win_5.2.dll</strong> to <strong>C:\wamp\bin\php\ioncube\</strong>. If you are using PHP version 5.1 then you need to copy the ioncube_loader_win_5.1.dll file. It&#8217;s the similar case for PHP 5.3. The folder path is not compulsory to be: C:\wamp\bin\php\ioncube\. You can keep it wherever you like.</p>
<p>- Open <strong>php.ini</strong> file and write the following line:<br />
<strong>zend_extension_ts = C:\wamp\bin\php\ioncube\ioncube_loader_win_5.2.dll</strong>.<br />
Remember that in my case, I have stored <strong>ioncube_loader_win_5.2.dll</strong> file in <strong>C:\wamp\bin\php\ioncube\</strong> path.</p>
<p>- Restart apache.</p>
<p>Now, you can browse the encoded php files.</p>
<p>Hope this helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1111&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/how-to-change-the-source-code-and-modifyparse-a-website/' rel='bookmark' title='Permanent Link: How to change the source code and modify/parse a website?'>How to change the source code and modify/parse a website?</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-get-html-source-code-of-a-website/' rel='bookmark' title='Permanent Link: How to get(view) html source code of a website'>How to get(view) html source code of a website</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-find-php-version-and-php-ini-file-location-path/' rel='bookmark' title='Permanent Link: How to find php version and php.ini file location path?'>How to find php version and php.ini file location path?</a></li>
<li><a href='http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/' rel='bookmark' title='Permanent Link: PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address'>PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address</a></li>
<li><a href='http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/' rel='bookmark' title='Permanent Link: PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)'>PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-source-code-encoding-with-ioncube-php-encoder/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP: Easily create PDF on the fly</title>
		<link>http://blog.chapagain.com.np/php-easily-create-pdf-on-the-fly/</link>
		<comments>http://blog.chapagain.com.np/php-easily-create-pdf-on-the-fly/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 04:15:26 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[fpdf]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[tcpdf]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1082</guid>
		<description><![CDATA[Here, I will be writing about two pdf creation PHP Classes. They are FPDF and TCPDF. With these classes, you can quickly, easily and effectively generate PDF files. FPDF is smaller in size compared to TCPDF. But, in functionalities, TCPDF wins. TCPDF has lots of features and functionalities. If you want very advanced features in [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/templating-in-smarty/' rel='bookmark' title='Permanent Link: Templating in Smarty'>Templating in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-simplexml/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with SimpleXML'>PHP : Read Write Xml with SimpleXML</a></li>
<li><a href='http://blog.chapagain.com.np/magento-showing-store-selector-switcher-in-header-and-footer/' rel='bookmark' title='Permanent Link: Magento: Showing Store Selector / Switcher in header and footer'>Magento: Showing Store Selector / Switcher in header and footer</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-domdocument/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with DOMDocument'>PHP : Read Write Xml with DOMDocument</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will be writing about two pdf creation PHP Classes. They are <strong><a href="http://www.fpdf.org/en/home.php" rel="nofollow">FPDF</a></strong> and <strong><a href="http://www.tcpdf.org/index.php" rel="nofollow">TCPDF</a></strong>. With these classes, you can quickly, easily and effectively generate PDF files.</p>
<p>FPDF is smaller in size compared to TCPDF. But, in functionalities, TCPDF wins. TCPDF has lots of features and functionalities. </p>
<p><span id="more-1082"></span></p>
<p>If you want very advanced features in PDF creation then TCPDF is for you. And, if you want just minimal features of PDF creation and want a smaller in size class then FPDF is for you.</p>
<p><strong>FPDF Library: The PDF generator</strong></p>
<p>Here is what the <strong><a href="http://www.fpdf.org/en/home.php" rel="nofollow">FPDF website</a></strong> has to say about itself:-</p>
<blockquote><p>
FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.</p>
<p>FPDF has other advantages: high level functions. Here is a list of its main features:</p>
<p>- Choice of measure unit, page format and margins<br />
- Page header and footer management<br />
- Automatic page break<br />
- Automatic line break and text justification<br />
- Image support (JPEG, PNG and GIF)<br />
- Colors<br />
- Links<br />
- TrueType, Type1 and encoding support<br />
- Page compression</p>
<p>FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5
</p></blockquote>
<p><strong>Example code to create PDF file</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require('fpdf.php');

class PDF extends FPDF
{
//Page header
function Header()
{
    //Logo
    $this-&gt;Image('logo_pb.png',10,8,33);
    //Arial bold 15
    $this-&gt;SetFont('Arial','B',15);
    //Move to the right
    $this-&gt;Cell(80);
    //Title
    $this-&gt;Cell(30,10,'Title',1,0,'C');
    //Line break
    $this-&gt;Ln(20);
}

//Page footer
function Footer()
{
    //Position at 1.5 cm from bottom
    $this-&gt;SetY(-15);
    //Arial italic 8
    $this-&gt;SetFont('Arial','I',8);
    //Page number
    $this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo().'/{nb}',0,0,'C');
}
}

//Instanciation of inherited class
$pdf=new PDF();
$pdf-&gt;AliasNbPages();
$pdf-&gt;AddPage();
$pdf-&gt;SetFont('Times','',12);
for($i=1;$i&lt;=40;$i++)
    $pdf-&gt;Cell(0,10,'Printing line number '.$i,0,1);
$pdf-&gt;Output();
?&gt;
</pre>
<p><strong><a href="http://www.fpdf.org/en/tutorial/tuto2.php" rel="nofollow">DEMO OF THE CODE ABOVE</a></strong></p>
<p><strong><a href="http://www.fpdf.org/en/download.php" rel="nofollow">DOWNLOAD FPDF</a></strong> || <strong><a href="http://www.fpdf.org/en/tutorial/index.php" rel="nofollow">MORE TUTORIALS AND EXAMPLES</a></strong></p>
<p><strong>TCPDF &#8211; PHP class for PDF</strong></p>
<p>Here is the introduction and main features of <strong><a href="http://www.tcpdf.org/index.php" rel="nofollow">TCPDF</a></strong>:-</p>
<blockquote><p>
Started in 2002, TCPDF is now one of the world&#8217;s most active Open Source projects, used daily by millions o users and included in thousands of CMS and Web applications. TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF Supports UTF-8, Unicode, RTL languages, XHTML, Javascript, digital signatures, barcodes and much more.</p>
<p><strong>Main Features</strong></p>
<p>- no external libraries are required for the basic functions;<br />
- all standard page formats, custom page formats, custom margins and units of measure;<br />
- UTF-8 Unicode and Right-To-Left languages;<br />
- TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;<br />
- font subsetting;<br />
- methods to publish some XHTML + CSS code, Javascript and Forms;<br />
- images, graphic (geometric figures) and transformation methods;<br />
- supports JPEG, PNG and SVG images natively, all images supported by GD and all images supported via ImagMagick;<br />
- 1D and 2D barcodes;<br />
- Grayscale, RGB, CMYK, Spot Colors and Transparencies;<br />
- automatic page header and footer management;<br />
- document encryption up to 256 bit and digital signature certifications;<br />
- transactions to UNDO commands;<br />
- PDF annotations, including links, text and file attachments;<br />
- text rendering modes (fill, stroke and clipping);<br />
- multiple columns mode;<br />
- no-write page regions;<br />
- bookmarks and table of content;<br />
- text hyphenation;<br />
- text stretching and spacing (tracking/kerning);<br />
- automatic page break, line break and text alignments including justification;<br />
- automatic page numbering and page groups;<br />
- move and delete pages;<br />
- page compression (requires php-zlib extension);<br />
- XOBject templates;
</p></blockquote>
<p><strong>Example code to create PDF file</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require_once('../config/lang/eng.php');
require_once('../tcpdf.php');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf-&gt;SetCreator(PDF_CREATOR);
$pdf-&gt;SetAuthor('Nicola Asuni');
$pdf-&gt;SetTitle('TCPDF Example 001');
$pdf-&gt;SetSubject('TCPDF Tutorial');
$pdf-&gt;SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf-&gt;SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING);

// set header and footer fonts
$pdf-&gt;setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf-&gt;setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf-&gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf-&gt;SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf-&gt;SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf-&gt;SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf-&gt;setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf-&gt;setLanguageArray($l);

// ---------------------------------------------------------

// set default font subsetting mode
$pdf-&gt;setFontSubsetting(true);

// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
$pdf-&gt;SetFont('dejavusans', '', 14, '', true);

// Add a page
// This method has several options, check the source code documentation for more information.
$pdf-&gt;AddPage();

// Set some content to print
$html = &lt;&lt;&lt;EOD
&lt;h1&gt;Welcome to &lt;a href=&quot;http://www.tcpdf.org&quot; style=&quot;text-decoration:none;background-color:#CC0000;color:black;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color:black;&quot;&gt;TC&lt;/span&gt;&lt;span style=&quot;color:white;&quot;&gt;PDF&lt;/span&gt;&amp;nbsp;&lt;/a&gt;!&lt;/h1&gt;
&lt;i&gt;This is the first example of TCPDF library.&lt;/i&gt;
&lt;p&gt;This text is printed using the &lt;i&gt;writeHTMLCell()&lt;/i&gt; method but you can also use: &lt;i&gt;Multicell(), writeHTML(), Write(), Cell() and Text()&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;Please check the source code documentation and other examples for further information.&lt;/p&gt;
&lt;p style=&quot;color:#CC0000;&quot;&gt;TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE &lt;a href=&quot;http://sourceforge.net/donate/index.php?group_id=128076&quot;&gt;MAKE A DONATION!&lt;/a&gt;&lt;/p&gt;
EOD;

// Print text using writeHTMLCell()
$pdf-&gt;writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);

// ---------------------------------------------------------

// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf-&gt;Output('example_001.pdf', 'I');
?&gt;
</pre>
<p><strong><a href="http://www.tcpdf.org/examples/example_001.pdf" rel="nofollow">DEMO OF THE CODE ABOVE</a></strong></p>
<p><strong><a href="http://sourceforge.net/projects/tcpdf/" rel="nofollow">DOWNLOAD TCPDF</a></strong> || <strong><a href="http://www.tcpdf.org/examples.php" rel="nofollow">MORE TUTORIALS AND EXAMPLES</a></strong></p>
<p>You can use any one or both of them based on your requirements.</p>
<p>Cheers :)</p>
<p>Buy domains at <a href="http://www.networksolutions.com/" rel="nofollow"  target="_blank">Network Solutions</a></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1082&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/templating-in-smarty/' rel='bookmark' title='Permanent Link: Templating in Smarty'>Templating in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-simplexml/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with SimpleXML'>PHP : Read Write Xml with SimpleXML</a></li>
<li><a href='http://blog.chapagain.com.np/magento-showing-store-selector-switcher-in-header-and-footer/' rel='bookmark' title='Permanent Link: Magento: Showing Store Selector / Switcher in header and footer'>Magento: Showing Store Selector / Switcher in header and footer</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-domdocument/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with DOMDocument'>PHP : Read Write Xml with DOMDocument</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-easily-create-pdf-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>phpThumb(): The best PHP thumbnail image generator</title>
		<link>http://blog.chapagain.com.np/phpthumb-the-best-php-thumbnail-image-generator/</link>
		<comments>http://blog.chapagain.com.np/phpthumb-the-best-php-thumbnail-image-generator/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 00:58:51 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1061</guid>
		<description><![CDATA[As far as I see, I find phpThumb() as the best of all PHP thumbnail image generator. It has lots of thumbnail generation features. You can create thumbnail in a number of ways with phpThumb(). phpThumb() uses the GD library to create thumbnails from images (JPEG, PNG, GIF, BMP, etc) on the fly. Basic functionality [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/generating-random-image/' rel='bookmark' title='Permanent Link: Generating random image'>Generating random image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As far as I see, I find <strong>phpThumb()</strong> as the best of all PHP thumbnail image generator. It has lots of thumbnail generation features. You can create thumbnail in a number of ways with phpThumb().</p>
<blockquote><p>
<strong>phpThumb()</strong> uses the GD library to create thumbnails from images (JPEG, PNG, GIF, BMP, etc) on the fly. Basic functionality is available even if GD functions are not installed (as long as ImageMagick is installed). </p>
<p><span id="more-1061"></span></p>
<p>Features include optional resizing, cropping, watermarking, unsharp mask sharpening, rotating, caching, borders, GIF reading with/without GD support, EXIF thumbnails can be extracted and/or used for large-source support, works with any GD version, and much more.
</p></blockquote>
<p><strong>Supported source image formats:</strong></p>
<blockquote><p>
JPEG (via GD or ImageMagick)<br />
PNG (via GD or ImageMagick)<br />
GIF (via GD, ImageMagick, or phpthumb.gif.php)<br />
BMP (via ImageMagick or phpthumb.bmp.php)<br />
any image format ImageMagick can read
</p></blockquote>
<p><strong>Supported output image formats:</strong></p>
<blockquote><p>
JPEG (via GD or ImageMagick)<br />
PNG (via GD or ImageMagick)<br />
GIF (via GD or ImageMagick)<br />
BMP (via ImageMagick or phpthumb.bmp.php)<br />
ICO (via ImageMagick or phpthumb.ico.php)
</p></blockquote>
<p><strong>Some Image processing features:</strong></p>
<blockquote><p>
1. Source image can be a physical file on the local server, remote file over HTTP, or can be retrieved from a database.<br />
2. GIFs are supported on all versions of GD (even if GD does not have native GIF support) thanks to the GIF Util class by Fabien Ezber, or by ImageMagick.<br />
3. BMP source images can be used even if ImageMagick is not available.<br />
4. HTTP thumbnail creation can be limited to the current (or other list of) domain to prevent other sites from using your server to create their thumbnails.<br />
5. Linking to thumbnails from another domain can be prevented or watermarked.<br />
6. Thumbnails can be cached for less server load. Mulitple sizes of any source image can be cached seperately. Thumbnails are automatically updated when (local) source image is modified.<br />
7. Images can be rotated, either by an arbitary angle or auto-rotated to either portrait or landscape.<br />
8. Images can be cropped, either by a specified number of pixels or by a percentage of original image.<br />
9. A watermark image or text can be applied over the thumbnail in one of 10 positions or tiled.<br />
10. A border or frame can be applied.
</p></blockquote>
<p><a href="http://phpthumb.sourceforge.net/" rel="nofollow"><strong>COMPLETE LIST OF FEATURES</strong></a>  ||  <a href="http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php" rel="nofollow"><strong>DEMO PAGE WITH EXAMPLES</strong></a>  ||  <a href="http://sourceforge.net/projects/phpthumb/" rel="nofollow"><strong>DOWNLOAD</strong></a></p>
<p>Cheers :)</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1061&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/generating-random-image/' rel='bookmark' title='Permanent Link: Generating random image'>Generating random image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/phpthumb-the-best-php-thumbnail-image-generator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)</title>
		<link>http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/</link>
		<comments>http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 11:51:10 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[finance]]></category>
		<category><![CDATA[stock]]></category>
		<category><![CDATA[stock exchange]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=948</guid>
		<description><![CDATA[In this tutorial, I will be showing you how you can fetch any company&#8217;s data from Yahoo! Finance. INTRODUCTION First of all, let us see the stock quote data of top tech companies on Yahoo! Finance. View the basic Google stock chart on Yahoo! Finance: http://finance.yahoo.com/q?s=goog For eBay: http://finance.yahoo.com/q?s=EBAY For Amazon: http://finance.yahoo.com/q?s=AMZN For Apple: http://finance.yahoo.com/q?s=AAPL [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/add-edit-delete-login-register-in-php-a-simple-and-complete-tutorial/' rel='bookmark' title='Permanent Link: Add, edit, delete, login, register in PHP :: A simple and complete tutorial'>Add, edit, delete, login, register in PHP :: A simple and complete tutorial</a></li>
<li><a href='http://blog.chapagain.com.np/creating-dynamic-table-in-php/' rel='bookmark' title='Permanent Link: Creating dynamic table in PHP : Easy and Simple tutorial'>Creating dynamic table in PHP : Easy and Simple tutorial</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-enable-backorders/' rel='bookmark' title='Permanent Link: Magento: How to enable backorders?'>Magento: How to enable backorders?</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-domdocument/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with DOMDocument'>PHP : Read Write Xml with DOMDocument</a></li>
<li><a href='http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/' rel='bookmark' title='Permanent Link: PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address'>PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I will be showing you how you can fetch any company&#8217;s data from <a href="http://finance.yahoo.com" rel="nofollow" >Yahoo! Finance</a>.</p>
<h3>INTRODUCTION</h3>
<p><span id="more-948"></span></p>
<p>First of all, let us see the stock quote data of top tech companies on Yahoo! Finance.</p>
<p>View the basic <strong>Google stock chart on Yahoo! Finance</strong>: <a href="http://finance.yahoo.com/q?s=goog" rel="nofollow" >http://finance.yahoo.com/q?s=goog</a></p>
<p><strong>For eBay</strong>: <a href="http://finance.yahoo.com/q?s=EBAY" rel="nofollow" >http://finance.yahoo.com/q?s=EBAY</a><br />
<strong>For Amazon</strong>: <a href="http://finance.yahoo.com/q?s=AMZN" rel="nofollow" >http://finance.yahoo.com/q?s=AMZN</a><br />
<strong>For Apple</strong>: <a href="http://finance.yahoo.com/q?s=AAPL" rel="nofollow" >http://finance.yahoo.com/q?s=AAPL</a><br />
<strong>For Microsoft</strong>: <a href="http://finance.yahoo.com/q?s=MSFT" rel="nofollow" >http://finance.yahoo.com/q?s=MSFT</a><br />
<strong>For Yahoo</strong>: <a href="http://finance.yahoo.com/q?s=YHOO" rel="nofollow" >http://finance.yahoo.com/q?s=YHOO</a></p>
<p>Similarly, you can find for others. You just need to change the stock symbol.<br />
All industry list is present here: <a href="http://biz.yahoo.com/ic/ind_index.html" rel="nofollow" >http://biz.yahoo.com/ic/ind_index.html</a><br />
You can click on any industry sector from the list and see the stock symbol for industries.</p>
<h3>DEMONSTRATION</h3>
<p>Let us now fetch stock data from Yahoo! Finance.</p>
<p>You can get stock data from Yahoo from the following URL:<br />
<strong>http://finance.yahoo.com/d/quotes.csv?s=$stock&#038;f=$format</strong></p>
<p>Here,<br />
<strong>$stock</strong> = stock symbol (e.g. GOOG for Google, MSFT for Microsoft, APPL for Apple, etc.)<br />
<strong>$format</strong> = format or tags to be fetched</p>
<p>Example,</p>
<p><strong>http://finance.yahoo.com/d/quotes.csv?s=GOOG+AAPL+MSFT+YHOO&#038;f=snl1d1t1cv</strong></p>
<p>The above URL will fetch stock data of Google, Apple, Microsoft and Yahoo.<br />
It will fetch data for the following parameters:-</p>
<blockquote><p>s = Symbol<br />
n = Name<br />
l1 = Last Trade (Price Only)<br />
d1 = Last Trade Date<br />
t1 = Last Trade Time<br />
c = Change and Percent Change<br />
v = Volume</p></blockquote>
<p><strong>FIND STOCK SYMBOLS FOR ANY COMPANY</strong></p>
<p>All industry list is present here: <a href="http://biz.yahoo.com/ic/ind_index.html" rel="nofollow" >http://biz.yahoo.com/ic/ind_index.html</a><br />
You can click on any industry sector from the list and see the stock symbol for industries.</p>
<p><strong>FIND COMPLETE LIST OF PARAMETERS</strong></p>
<p>Complete list of parameters that can be fetched from Yahoo.</p>
<blockquote><p>a – Ask<br />
a2 – Average Daily Volume<br />
a5 – Ask Size<br />
b – Bid<br />
b2 – Ask (Real-time)<br />
b3 – Bid (Real-time)<br />
b4 – Book Value<br />
b6 – Bid Size<br />
c – Change and Percent Change<br />
c1 – Change<br />
c3 – Commission<br />
c6 – Change (Real-time)<br />
c8 – After Hours Change (Real-time)<br />
d – Dividend/Share<br />
d1 – Last Trade Date<br />
d2 – Trade Date<br />
e – Earnings/Share<br />
e1 &#8211; Error Indication (returned for symbol changed /  invalid)<br />
e7 – EPS Est. Current Year<br />
e8 – EPS Est. Next Year<br />
e9 – EPS Est. Next Quarter<br />
f6 – Float Shares<br />
g &#8211; Day&#8217;s Low<br />
g1 – Holdings Gain Percent<br />
g3 – Annualized Gain<br />
g4 – Holdings Gain<br />
g5 – Holdings Gain Percent (Real-time)<br />
g6 – Holdings Gain (Real-time)<br />
h &#8211; Day&#8217;s High<br />
i – More Info<br />
i5 – Order Book (Real-time)<br />
j &#8211; 52-week Low<br />
j1 – Market Capitalization<br />
j3 – Market Cap (Real-time)<br />
j4 – EBITDA<br />
j5 – Change from 52 Week Low<br />
j6 – Percent Change from 52 Week Low<br />
k &#8211; 52-week High<br />
k1 – Last Trade (Real-time) with Time<br />
k2 – Change Percent (Real-time)<br />
k3 – Last Trade Size<br />
k4 – Change from 52 Week High<br />
k5 – Percent Change from 52 Week High<br />
l – Last Trade (with time)<br />
l1 – Last Trade (without time)<br />
l2 – High Limit<br />
l3 – Low Limit<br />
m – Day’s Range<br />
m2 – Day’s Range (Real-time)<br />
m3 – 50 Day Moving Average<br />
m4 – 200 Day Moving Average<br />
m5 – Change from 200 Day Moving Average<br />
m6 – Percent Change from 200 Day Moving Average<br />
m7 – Change from 50 Day Moving Average<br />
m8 – Percent Change from 50 Day Moving Average<br />
n – Name<br />
n4 – Notes<br />
o – Open<br />
p – Previous Close<br />
p1 – Price Paid<br />
p2 – Change in Percent<br />
p5 – Price/Sales<br />
p6 – Price/Book<br />
q – Ex-Dividend Date<br />
r – P/E Ratio<br />
r1 – Dividend Pay Date<br />
r2 – P/E (Real-time)<br />
r5 – PEG Ratio<br />
r6 – Price/EPS Est. Current Year<br />
r7 – Price/EPS Est. Next Year<br />
s – Symbol<br />
s1 – Shares Owned<br />
s7 – Short Ratio<br />
t1 – Last Trade Time<br />
t6 – Trade Links<br />
t7 – Ticker Trend<br />
t8 – 1 Year Target Price<br />
v – Volume<br />
v1 – Holdings Value<br />
v7 – Holdings Value (Real-time)<br />
w – 52 Week Range<br />
w1 – Day’s Value Change<br />
w4 – Day’s Value Change (Real-time)<br />
x – Stock Exchange<br />
y – Dividend Yield</p></blockquote>
<h3>PHP CODE TO FETCH STOCK DATA FROM YAHOO! FINANCE</h3>
<p>I have made two files for this purpose. The class file contains class and function to fetch the required data. And the usuage file contains code to display it. I have written enough comments in the code for better understanding.</p>
<p><strong>Class file (class.yahoostock.php)</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/**
 * Class to fetch stock data from Yahoo! Finance
 *
 */

class YahooStock {

	/**
	 * Array of stock code
	 */
    private $stocks = array();

	/**
	 * Parameters string to be fetched
	 */
	private $format;

    /**
     * Populate stock array with stock code
	 *
     * @param string $stock Stock code of company
     * @return void
     */
    public function addStock($stock)
    {
        $this-&gt;stocks[] = $stock;
    }

	/**
     * Populate parameters/format to be fetched
	 *
     * @param string $param Parameters/Format to be fetched
     * @return void
     */
	public function addFormat($format)
    {
        $this-&gt;format = $format;
    }

    /**
     * Get Stock Data
	 *
     * @return array
     */
    public function getQuotes()
    {
        $result = array();
		$format = $this-&gt;format;

        foreach ($this-&gt;stocks as $stock)
        {
			/**
			 * fetch data from Yahoo!
			 * s = stock code
			 * f = format
			 * e = filetype
			 */
            $s = file_get_contents(&quot;http://finance.yahoo.com/d/quotes.csv?s=$stock&amp;f=$format&amp;e=.csv&quot;);

			/**
			 * convert the comma separated data into array
			 */
            $data = explode( ',', $s);

			/**
			 * populate result array with stock code as key
			 */
            $result[$stock] = $data;
        }
        return $result;
    }
}
</pre>
<p><strong>Usage file (yahoostock.php)</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
include_once('class.yahoostock.php');

$objYahooStock = new YahooStock;

/**
	Add format/parameters to be fetched

	s = Symbol
	n = Name
	l1 = Last Trade (Price Only)
	d1 = Last Trade Date
	t1 = Last Trade Time
	c = Change and Percent Change
	v = Volume
 */
$objYahooStock-&gt;addFormat(&quot;snl1d1t1cv&quot;); 

/**
	Add company stock code to be fetched

	msft = Microsoft
	amzn = Amazon
	yhoo = Yahoo
	goog = Google
	aapl = Apple
 */
$objYahooStock-&gt;addStock(&quot;msft&quot;);
$objYahooStock-&gt;addStock(&quot;amzn&quot;);
$objYahooStock-&gt;addStock(&quot;yhoo&quot;);
$objYahooStock-&gt;addStock(&quot;goog&quot;);
$objYahooStock-&gt;addStock(&quot;vgz&quot;); 

/**
 * Printing out the data
 */
foreach( $objYahooStock-&gt;getQuotes() as $code =&gt; $stock)
{
	?&gt;
	Code: &lt;?php echo $stock[0]; ?&gt; &lt;br /&gt;
	Name: &lt;?php echo $stock[1]; ?&gt; &lt;br /&gt;
	Last Trade Price: &lt;?php echo $stock[2]; ?&gt; &lt;br /&gt;
	Last Trade Date: &lt;?php echo $stock[3]; ?&gt; &lt;br /&gt;
	Last Trade Time: &lt;?php echo $stock[4]; ?&gt; &lt;br /&gt;
	Change and Percent Change: &lt;?php echo $stock[5]; ?&gt; &lt;br /&gt;
	Volume: &lt;?php echo $stock[6]; ?&gt; &lt;br /&gt;&lt;br /&gt;
	&lt;?php
}
?&gt;
</pre>
<p>Hope this helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=948&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/add-edit-delete-login-register-in-php-a-simple-and-complete-tutorial/' rel='bookmark' title='Permanent Link: Add, edit, delete, login, register in PHP :: A simple and complete tutorial'>Add, edit, delete, login, register in PHP :: A simple and complete tutorial</a></li>
<li><a href='http://blog.chapagain.com.np/creating-dynamic-table-in-php/' rel='bookmark' title='Permanent Link: Creating dynamic table in PHP : Easy and Simple tutorial'>Creating dynamic table in PHP : Easy and Simple tutorial</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-enable-backorders/' rel='bookmark' title='Permanent Link: Magento: How to enable backorders?'>Magento: How to enable backorders?</a></li>
<li><a href='http://blog.chapagain.com.np/php-read-write-xml-with-domdocument/' rel='bookmark' title='Permanent Link: PHP : Read Write Xml with DOMDocument'>PHP : Read Write Xml with DOMDocument</a></li>
<li><a href='http://blog.chapagain.com.np/php-maxmind-geoip-get-country-city-postal-code-much-more-by-ip-address/' rel='bookmark' title='Permanent Link: PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address'>PHP MaxMind GeoIP: Get country, city, postal code &#038; much more by IP Address</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/php-how-to-get-stock-quote-data-from-yahoo-finance-complete-code-and-tutorial/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
