<?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>Tips and Tricks &#187; PHP</title>
	<atom:link href="http://www.legend.ws/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.legend.ws/blog</link>
	<description>Random tech ramblings</description>
	<lastBuildDate>Wed, 11 Jan 2012 16:11:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Display page load time</title>
		<link>http://www.legend.ws/blog/tips-tricks/display-page-load-time/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/display-page-load-time/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 15:23:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=76</guid>
		<description><![CDATA[<p>You may want to display the time it took to load a page.<br />
Following is a set of simple PHP code which would help you achieve this goal.</p>
<p>Place the following snippet at the very top of your page.<br />
(Ultimately, it&#8217;s advisable to have a header file and a footer file that are included on every page of your website).</p>
<p>&#60;?php<br />
$timer_start = str_replace(&#34; &#34;,&#34;&#34;,microtime());<br />
?&#62;</p>
<p>Then place the following code at the very end of your footer.</p>
<p>&#60;?php<br />
$timer_end = str_replace(&#34; &#34;,&#34;&#34;,microtime());<br />
$timer_diff = number_format($timer_end-$timer_start,6,&#39;.&#39;,&#39;&#39;);<br />
if($timer_diff&#60;0) $timer_diff = &#34;0.00&#34;;<br />
echo &#34;&#60;div id=&#39;load-time&#39; style=&#39;font-family: verdana; font-size: 8pt; color: #444444; text-align: &#8230;</p>]]></description>
		<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/display-page-load-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add authentication to any php page the easy way</title>
		<link>http://www.legend.ws/blog/tips-tricks/php-authentication-login-script/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/php-authentication-login-script/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 11:40:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/tips-tricks/php-authentication-login-script/</guid>
		<description><![CDATA[<p><img class="alignleft size-thumbnail wp-image-183" style="border: 0pt none; margin: 5px 10px;" title="phplogo" src="http://www.legend.ws/blog/wp-content/uploads/2007/04/phplogo-150x150.png" alt="" width="100" height="100" />This is useful for anyone who&#8217;d like to add a login form to any php page.</p>
<p>Simply, save the following <a title="code" href="http://www.legend.ws/blog/access.phps">code</a> as access.php, and insert the following snippet on the first line of any php file you want protected.</p>
<p>&#60; ?php include &#8220;access.php&#8221;; ?&#62; (remove the space before the question mark)</p>
<p>Voila! as easy as 1,2,3. The crentials can be edited in the access.php file, by changing the values of $ADMIN_USER and $ADMIN_PASSWORD.</p>
<p>This useful script requires no database, and no big tweaking to the code on your pages.&#8230;</p>]]></description>
		<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/php-authentication-login-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP script to import csv data into mysql</title>
		<link>http://www.legend.ws/blog/tips-tricks/csv-php-mysql-import/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/csv-php-mysql-import/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 20:01:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://legend.ws/blog/tips-tricks/csv-php-mysql-import/</guid>
		<description><![CDATA[<p><img class="alignleft size-thumbnail wp-image-174" style="border: 0pt none; margin: 5px 10px;" title="php" src="http://www.legend.ws/blog/wp-content/uploads/2007/02/php-150x150.jpg" alt="" width="100" height="100" />This is a simple script that will allow you to import csv data into your database. This comes handy because you can simply edit the appropriate fields, upload it along with the csv file and call it from the web and it will do the rest.</p>
<p>It allows you to specify the delimiter in this csv file, whether it is a coma, a tab etc. It also allows you to chose the line separator,  allows you to save the output to a file (known as a data sql dump).</p>
<p>It also permits you to include an empty field at the &#8230;</p>]]></description>
		<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/csv-php-mysql-import/feed/</wfw:commentRss>
		<slash:comments>135</slash:comments>
		</item>
		<item>
		<title>How to import a csv file into mysql from the prompt</title>
		<link>http://www.legend.ws/blog/tips-tricks/import-csv-mysql-prompt/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/import-csv-mysql-prompt/#comments</comments>
		<pubDate>Thu, 11 Jan 2007 17:40:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/tips-tricks/import-csv-mysql-prompt/</guid>
		<description><![CDATA[<p>For the follows out there who do not know how to import coma separated data into mysql from the prompt, here it is:</p>
<p>Assume:</p>
<p>PATH is the path to the csv file (can be relative to the directory you were in before logging into mysql)<br />
TABLE is the table name that you have already created and whos fields match the csv file fields.<br />
USERNAME is the mysql user that have access to insert data into TABLE<br />
DATABASE is the database containing that table</p>
<p>- login to mysql by typing: mysql -u USERNAME -p DATABASE<br />
The prompt will ask you for &#8230;</p>]]></description>
		<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/import-csv-mysql-prompt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

