<?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>Php Tutorials</title>
	<atom:link href="http://www.urphp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.urphp.com</link>
	<description>Free Php Tutorials and Scripts, UrPhp.com</description>
	<lastBuildDate>Tue, 19 Apr 2011 10:40:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>10+ Php Paginations</title>
		<link>http://www.urphp.com/10-php-paginations/</link>
		<comments>http://www.urphp.com/10-php-paginations/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 10:40:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[php pagination]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=378</guid>
		<description><![CDATA[I have found some beautiful and best 10+ Php Paginations Scripts and Tutorials with well written and explained tutorials...]]></description>
			<content:encoded><![CDATA[<h4>How to Paginate Data with PHP</h4>
<p><a href="http://net.tutsplus.com/tutorials/php/how-to-paginate-data-with-php/"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/1.gif"></a></p>
<h4>Easy PHP Pagination</h4>
<p><a href="http://papermashup.com/easy-php-pagination/"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/2.gif"></a></p>
<h4>How To Create A Pagination In PHP</h4>
<p><a href="http://www.jooria.com/PHP-Pagination-a125.html"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/3.gif"></a></p>
<h4>Digg-Style Pagination</h4>
<p><a href="http://www.strangerstudios.com/sandbox/pagination/diggstyle.php"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/4.gif"></a></p>
<h4>Perfect PHP Pagination Article</h4>
<p><a href="http://blogs.sitepoint.com/perfect-php-pagination/"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/5.gif"></a></p>
<h4>Simple Pagination in PHP tutorial</h4>
<p><a href="http://www.codediesel.com/php/simple-pagination-in-php/"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/6.gif"></a></p>
<h4>PHP Pagination</h4>
<p><a href="http://www.phpeasystep.com/phptu/29.html"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/7.gif"></a></p>
<h4>PHP Pagination Tutorial</h4>
<p><a href="http://www.ittreats.com/os/php/php-pagination-tutorial.html"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
<h4>PHP pagination</h4>
<p><a href="http://snippets.dzone.com/posts/show/6459"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
<h4>PHP pagination class</h4>
<p><a href="http://www.phpsnaps.com/snaps/view/php-pagination-class/"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
<h4>Pagination of MySQL Query Results</h4>
<p><a href="http://php.about.com/od/phpwithmysql/ss/php_pagination.htm"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
<h4>Basic Pagination</h4>
<p><a href="http://www.phpfreaks.com/tutorial/basic-pagination"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
<h4>PHP Pagination Script</h4>
<p><a href="http://phpsense.com/php/php-pagination-script.html"><br />
<img src="http://www.urphp.com/wp-content/download/php-pagination/8.gif"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/10-php-paginations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 Php Rating Systems</title>
		<link>http://www.urphp.com/top-10-php-rating-systems/</link>
		<comments>http://www.urphp.com/top-10-php-rating-systems/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 22:09:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript and Jquery]]></category>
		<category><![CDATA[rating system]]></category>
		<category><![CDATA[ratings]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=375</guid>
		<description><![CDATA[I have find something new, just searching the web i have collected the Top 10 Php &#038; MySql Rating Systems and Tutorials, There are many more but these are the best of them...]]></description>
			<content:encoded><![CDATA[<h4>Unobtrusive AJAX Star Rating Bar</h4>
<p><a href="http://masugadesign.com/software/unobtrusive-ajax-star-rating-bar/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/1.gif"></a></p>
<h4>Css Star Rating Part Deux</h4>
<p><a href="http://www.komodomedia.com/blog/2006/01/css-star-rating-part-deux/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/2.gif"></a></p>
<h4>Building a 5 Star Rating System with jQuery, AJAX and PHP</h4>
<p><a href="http://net.tutsplus.com/tutorials/html-css-techniques/building-a-5-star-rating-system-with-jquery-ajax-and-php/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/3.gif"></a></p>
<h4>5 star rating system in PHP, MySQL and jQuery</h4>
<p><a href="http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/4.gif"></a></p>
<h4>Creating a 5 star rating system using jQuery, PHP and MySQL</h4>
<p><a href="http://www.tutorialswindow.com/jQuery/Creating-a-5-star-rating-system-using-jQuery,-PHP-and-MySQL-48/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/5.gif"></a></p>
<h4>Simple Star Rating System</h4>
<p><a href="http://php.scripts.psu.edu/rja171/widgets/rating.php"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/6.gif"></a></p>
<h4>Create Simple Ajax Rating System using jQuery AJAX and PHP</h4>
<p><a href="http://www.99points.info/2010/05/ajax-rating-system-create-simple-ajax-rating-system-using-jquery-ajax-and-php/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/7.gif"></a></p>
<h4>Rating System &#8211; PHP version</h4>
<p><a href="http://www.dwbooster.com/feedback-tools/rating-system-php-version"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/8.gif"></a></p>
<h4>A Simple Rating System in PHP</h4>
<p><a href="http://php.about.com/od/finishedphp1/ss/rating_script.htm"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/9.gif"></a></p>
<h4>Simple 5 Star Rating System in Php adn MySql</h4>
<p><a href="http://tropiccreative.com/blog/2010/05/simple-5-star-rating-system-phpmysql/"><br />
<img src="http://www.urphp.com/wp-content/download/ratings/10.gif"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/top-10-php-rating-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>25+ Php Contact Us Forms</title>
		<link>http://www.urphp.com/20-php-contact-us-forms/</link>
		<comments>http://www.urphp.com/20-php-contact-us-forms/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 19:13:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basics & Beginner]]></category>
		<category><![CDATA[Php Forms]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=365</guid>
		<description><![CDATA[Today I have search the web, and i have collected about 25+ Php Contact Us Forms, i have collected 25+ Php Contact Us Forms well explained tutorials...]]></description>
			<content:encoded><![CDATA[<h4>Simple AS3 Contact Form Using PHP</h4>
<p><a href="http://active.tutsplus.com/freebies/actionscript-30-classes/simple-as3-contact-form-using-php/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/1.gif"></a></p>
<h4>Contact Form Tutorial Using Html and PHP</h4>
<p><a href="http://designmodo.com/contact-form-tutorial-using-html-and-php/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/2.gif"></a></p>
<h4>A Nice &#038; Simple Contact Form </h4>
<p><a href="http://css-tricks.com/nice-and-simple-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/3.gif"></a></p>
<h4>Create a simple Flash/PHP mail contact form with Actionscript 3.0 and MySQL</h4>
<p><a href="http://www.thetechlabs.com/tech-tutorials/interfaces/how-to-create-a-simple-flashphp-mail-contact-form-with-as3-and-mysql/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/4.gif"></a></p>
<h4>PHP Contact Form with jQuery Validation</h4>
<p><a href="http://www.raymondselda.com/php-contact-form-with-jquery-validation/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/5.gif"></a></p>
<h4>Build Your Own Captcha and Contact Form</h4>
<p><a href="http://net.tutsplus.com/tutorials/php/build-your-own-captcha-and-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/6.gif"></a></p>
<h4>Contact Form Tutorial Using Html and PHP</h4>
<p><a href="http://www.tutorialspalace.com/2011/03/contact-form-tutorial-using-html-and-php/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/7.gif"></a></p>
<h4>A Fancy AJAX Contact Form</h4>
<p><a href="http://tutorialzine.com/2009/09/fancy-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/8.gif"></a></p>
<h4>PHP Form Data Validation Tips</h4>
<p><a href="http://www.learncomputer.com/php-form-data-validation-tips/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/9.gif"></a></p>
<h4>Creating simple PHP contact form</h4>
<p><a href="http://www.phpeasystep.com/phptu/8.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/11.gif"></a></p>
<h4>Ajax Contact Form</h4>
<p><a href="http://www.ajaxtutorial.net/index.php/ajax-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/12.gif"></a></p>
<h4>Flash Contact Form in ActionScript 3</h4>
<p><a href="http://www.webdesignmo.com/blog/2008/08/14/flash-contact-form-in-actionscript-3/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/13.gif"></a></p>
<h4>A Simple Yet Elegant Contact Form In PHP</h4>
<p><a href="http://www.learnphponline.com/scripts/a-simple-yet-elegant-contact-form-in-php"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/14.gif"></a></p>
<h4>Simple PHP Contact Form Tutorial</h4>
<p><a href="http://www.tutorialspalace.com/2010/05/simple-php-contact-form-tutorial/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/15.gif"></a></p>
<h4>PHP Contact Form</h4>
<p><a href="http://www.kirupa.com/web/php_contact_form.htm"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/16.gif"></a></p>
<h4>IBDhost Contact Form</h4>
<p><a href="http://www.ibdhost.com/contact/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/17.gif"></a></p>
<h4>Create a Readable Email Contact Form with PHP</h4>
<p><a href="http://gloucesterwebdesign.com/phpcontact/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/18.gif"></a></p>
<h4>Flash Contact Form Tutorial</h4>
<p><a href="http://www.flashkid.org/Tutorials/flash_contact_form.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/19.gif"></a></p>
<h4>Flash AS3 Contact Form Using PHP</h4>
<p><a href="http://www.warmforestflash.com/blog/2009/06/flash-as3-contact-form-using-php/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/1.gif"></a></p>
<h4>Creating a Secure Contact Form for Your Website</h4>
<p><a href="http://www.matthewwatts.net/tutorials/php-tutorial-1-creating-a-secure-contact-form-for-your-website/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/20.gif"></a></p>
<h4>PHP Advanced contact Form Tutorial</h4>
<p><a href="http://www.desipad.com/tutorials/312-php-advanced-contact-form-tutorial.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>Create a secure PHP contact form for your website</h4>
<p><a href="http://sneakybox.com/blog/tutorial/secure-php-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>Creating Simple PHP Contact Form</h4>
<p><a href="http://www.designscollage.com/2010/06/creating-simple-php-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/22.gif"></a></p>
<h4>Contact Form Tutorial</h4>
<p><a href="http://www.phphelptutorials.com/tp-contact-form-tutorial"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>Create A Simple PHP Contact Form</h4>
<p><a href="http://boxmodeljunkie.com/create-a-simple-php-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/23.gif"></a></p>
<h4>A Basic Contact Form with Captcha Explained</h4>
<p><a href="http://www.moneymakerdiscussion.com/forum/php/25946-beginner-tutorial-basic-contact-form-captcha-explained.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/24.gif"></a></p>
<h4>Free, simple, PHP based email contact form</h4>
<p><a href="http://www.html-form-guide.com/contact-form/php-email-contact-form.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>PHP Contact Form</h4>
<p><a href="http://www.thetutorialblog.com/php/php-contact-form/"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>Create Contact Us form for website</h4>
<p><a href="http://www.masia.pk/read_tutorial.php?type=3&#038;title=Create_Contact_Us_form_for_website"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
<h4>Create a Contact Form for your website, PHP Script Dreamweaver Tutorial</h4>
<p><a href="http://www.createurownwebsite.net/web-design/create-a-contact-form-page-for-your-website-php-script-dreamweaver-tutorial.html"><br />
<img src="http://www.urphp.com/wp-content/download/contact-email/21.gif"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/20-php-contact-us-forms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Php ereg_replace() function</title>
		<link>http://www.urphp.com/php-ereg_replace-function/</link>
		<comments>http://www.urphp.com/php-ereg_replace-function/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 19:23:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basics & Beginner]]></category>
		<category><![CDATA[Php Functions]]></category>
		<category><![CDATA[ereg_replace()]]></category>
		<category><![CDATA[ereg_replace() function]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=351</guid>
		<description><![CDATA[What is ereg_replace() function? This function scans string for matches to pattern, then replaces the matched text with replacement, this tutorial is well explained with 9 Examples.]]></description>
			<content:encoded><![CDATA[<h2>Php ereg_replace() Function</h2>
<p>The ereg_replace() function searches for string specified by pattern and replaces pattern with replacement if found. The ereg_replace() function operates under the same premises as ereg(), except that the functionality is extended to finding and replacing pattern instead of simply locating it.</p>
<h2>Syntax</h2>
<pre class="brush: php;">
string ereg_replace ( string $pattern , string $replacement , string $string )
</pre>
<p><strong>pattern:</strong> A POSIX extended regular expression.</p>
<p><strong>replacement:</strong> If pattern contains parenthesized substrings, replacement may contain substrings of the form \\digit, which will be replaced by the text matching the digit&#8217;th parenthesized substring; \\0 will produce the entire contents of string. Up to nine substrings may be used. Parentheses may be nested, in which case they are counted by the opening parenthesis.</p>
<p><strong>string:</strong>The input string.</p>
<h2>Example 1</h2>
<p>Simple String Replacement, Replacing <strong>&#8220;five&#8221;</strong> with <strong>&#8220;ten&#8221;</strong> in <strong>&#8220;I have five mangoes&#8221;</strong> String:</p>
<pre class="brush: php;">
echo ereg_replace(&quot;five&quot;, &quot;ten&quot;, &quot;I have five mangoes&quot;);
</pre>
<h3>Output</h3>
<pre class="brush: xml;">
From: I have five mangoes
To: I have ten mangoes
</pre>
<h2>Example 2</h2>
<p>Simple String Replacement, Replacing <strong>&#8220;to Buy Mangoes&#8221;</strong> with <strong>&#8220;Bananas&#8221;</strong> in <strong>&#8220;I like Bananas!&#8221;</strong> String:</p>
<pre class="brush: php;">
$string = &quot;I like Bananas&quot;;
echo ereg_replace(&quot;Bananas&quot;, &quot;to Buy Mangoes&quot;, $string);
</pre>
<h3>Output</h3>
<pre class="brush: xml;">
From: I like Bananas!
To: I like to Buy Mangoes!
</pre>
<h2>Example 3</h2>
<p>Simple String Replacement, Replacing <strong>&#8220;Windows&#8221;</strong> with <strong>&#8220;Mac Ox&#8221;</strong> in <strong>&#8220;I like Mac Ox!&#8221;</strong> String:</p>
<pre class="brush: php;">
$string = &quot;I like Mac Ox!&quot;;
$pattern = &quot;Mac Ox&quot;;
$replacement = &quot;Windows&quot;;
echo ereg_replace($pattern, $replacement, $string);
</pre>
<h3>Output</h3>
<pre class="brush: xml;">
From: I like Mac Ox!
To: I like Windows!
</pre>
<h2>Example 4</h2>
<p>Simple String Replacement, Replacing Spaces between words with Dashes(-) String:</p>
<pre class="brush: php;">
$string = &quot;Learn how to build your own website&quot;;
$pattern = &quot; &quot;;
$replacement = &quot;-&quot;;
echo ereg_replace($pattern, $replacement, $string);
</pre>
<h3>Output</h3>
<pre class="brush: xml;">
From: Learn how to build your own website.
To: Learn-how-to-buld-your-own-website.
</pre>
<h2>Example 5</h2>
<p>Simple String Replacement, Removing a word from the string:</p>
<pre class="brush: php;">
$string = &quot;How to make money online&quot;;
$pattern = &quot; online&quot;;
$replacement = &quot;&quot;;
echo ereg_replace($pattern, $replacement, $string);
</pre>
<h3>Output</h3>
<pre class="brush: xml;">
From: How to make money online
To: How to make money
</pre>
<h2>Example 6</h2>
<p>Simple String Replacement, highlighting a simple word:</p>
<pre class="brush: php;">
$string = &quot;Learn Php step by step here&quot;;
$pattern = &quot;Php&quot;;
$replacement = &quot;&lt;font color=red&gt;Php&lt;/font&gt;&quot;;
echo ereg_replace($pattern, $replacement, $string);
</pre>
<h3>Output</h3>
<p>From: Learn Php step by step here<br />
To: Learn <span style="color: red;">Php</span> step by step here</p>
<h2>Example 7</h2>
<p>Simple String Replacement, highlights the recognized patterns (a good tool for experiments) :</p>
<pre class="brush: php;">
$string = &quot;Learn Php step by step here&quot;;
$pattern = &quot;Php&quot;;
$replacement = &quot;&lt;font color=red&gt;\&#92;&#48;&lt;/font&gt;&quot;;
echo ereg_replace($pattern, $replacement, $string);
</pre>
<h3>Output</h3>
<p>From: Learn Php step by step here<br />
To: Learn <span style="color: red;">Php</span> step by step here</p>
<h2>Example 8</h2>
<p>Simple String Replacement, Make all url starts with &#8220;http://&#8221; clickable:</p>
<pre class="brush: php;">
$string = &quot;Do you want to learn php, please go to http://www.urphp.com&quot;;
echo ereg_replace(&quot;[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*&quot;, &quot;&lt;a href=\&quot;\&#92;&#48;\&quot;&gt;\&#92;&#48;&lt;/a&gt;&quot;, $string);
</pre>
<h3>Output</h3>
<p>From: Do you want to learn php, please go to www.urphp.com<br />
To: Do you want to learn php, please go to <a title="Php Tutorials" href="http://www.urphp.com" target="_blank">www.urphp.com</a></p>
<h2>Example 9</h2>
<p>Simple String Replacement, Make all url starts with &#8220;www&#8221; clickable:</p>
<pre class="brush: php;">
$string = &quot;Do you want to learn php, please go to www.urphp.com&quot;;
echo ereg_replace(&quot;(^| )(www([.]?[a-zA-Z0-9_/-])*)&quot;, &quot;\\1&lt;a href=\&quot;http://\\2\&quot;&gt;\\2&lt;/a&gt;&quot;, $string);
</pre>
<h3>Output</h3>
<p>From: Do you want to learn php, please go to www.urphp.com<br />
To: Do you want to learn php, please go to <a title="Php Tutorials" href="http://www.urphp.com" target="_blank">www.urphp.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/php-ereg_replace-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create an Rss Feed using Php and Mysql</title>
		<link>http://www.urphp.com/create-an-rss-feed-using-php-and-mysql/</link>
		<comments>http://www.urphp.com/create-an-rss-feed-using-php-and-mysql/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 11:23:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[php rss feed]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[rss feed]]></category>
		<category><![CDATA[xml rss feed]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=340</guid>
		<description><![CDATA[In this tutorial i will teach you how to create your own XML Rss Feed using Php and Mysql, i wrote this tutorial with full detail and easy to understand.]]></description>
			<content:encoded><![CDATA[<h2>What is RSS?</h2>
<p><strong>RSS</strong> (most commonly expanded as <strong>Really Simple Syndication</strong>) is a family of <a href="http://en.wikipedia.org/wiki/Web_feed">web feed</a> formats used to publish frequently updated works—such as <a href="http://en.wikipedia.org/wiki/Blog">blog</a> entries, news headlines, audio, and video—in a standardized format. An RSS document  includes full or summarized text, plus <a href="http://en.wikipedia.org/wiki/Metadata">metadata</a> such as publishing dates and authorship. Web feeds benefit publishers by letting them syndicate content automatically. They benefit readers who want to subscribe to timely updates from favored websites or to aggregate feeds from many sites into one place. RSS feeds can be read using <a title="Software" href="http://en.wikipedia.org/wiki/Software">software</a> called an &#8220;RSS reader&#8221;, &#8220;feed reader&#8221;, or &#8220;<a title="News aggregator" href="http://en.wikipedia.org/wiki/News_aggregator">aggregator</a>&#8220;, which can be <a title="Web application" href="http://en.wikipedia.org/wiki/Web_application">web-based</a>, <a title="Application software" href="http://en.wikipedia.org/wiki/Application_software">desktop-based</a>, or mobile-device-based.<br />
As RSS files are essentially XML formatted plain text, the RSS file itself is relatively easily read both by automated processes and by humans alike. An example file could have contents such as the following. This could be placed on any appropriate communication protocol for file retrieval, such as http or ftp, and reading software would use the information to present a neat display to the end user.</p>
<p><a title="What is Rss" href="http://www.problogger.net/what-is-rss/"><strong>Click here to view more details about What is Rss Feed?</strong></a></p>
<h2>File format (Syntax)</h2>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;rss version=&quot;2.0&quot;&gt;
&lt;channel&gt;
        &lt;title&gt;RSS Title&lt;/title&gt;
        &lt;description&gt;This is an example of an RSS feed&lt;/description&gt;
        &lt;link&gt;http://www.urcss.com/main.html&lt;/link&gt;
        &lt;lastBuildDate&gt;Mon, 06 Sep 2010 00:01:00 +0000 &lt;/lastBuildDate&gt;
        &lt;pubDate&gt;Mon, 06 Sep 2009 16:45:00 +0000 &lt;/pubDate&gt;

        &lt;item&gt;
                &lt;title&gt;Example entry&lt;/title&gt;
                &lt;description&gt;Here is some interesting description.&lt;/description&gt;
                &lt;link&gt;http://www.urcss.org/new-post/&lt;/link&gt;
                &lt;guid&gt;unique string per item&lt;/guid&gt;
                &lt;pubDate&gt;Fri, 04 April 2011 16:45:00 +0000 &lt;/pubDate&gt;
        &lt;/item&gt;

&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<h2>Lets Create the Rss Feed</h2>
<p>First we have to make our map skeleton with some needed stuff (for example database connection), Create a new <strong>&#8220;rssfeed.php&#8221;</strong> file and copy and paste the below code:</p>
<pre class="brush: php;">
&lt;?php $host = &quot;localhost&quot;; // host name
$user = &quot;user&quot;; // database user name
$pass = &quot;password&quot;; // database password
$database = &quot;dbname&quot;; // database name
// connecting to database
$connect = @mysql_connect($host,$user,$pass)or die (@mysql_error());
// selecting database
@mysql_select_db($database,$connect) or die (@mysql_error());
?&gt;
</pre>
<p><strong>$host:</strong> leave it default<br />
<strong>$user:</strong> change it to your database username<br />
<strong>$pass:</strong> change it to your database password<br />
<strong>$database:</strong> change it to your database name</p>
<h2>Set The Header, Begin the Feed</h2>
<p>Now lets add the default headers to your <strong>&#8220;rssfeed.php&#8221;</strong>, By default, PHP sends text with an HTML content type. As a result, your aggregator may not recognize it as a valid RSS / XML file. Enter the header() function. We&#8217;ll put the following header near the top of our script, before any text gets sent to the client. Copy and paste the below code under the database connecting and selecting code:</p>
<pre class="brush: php;">
&lt;?php
// default header(don't delete)
header(&quot;Content-Type: text/xml;charset=iso-8859-1&quot;);
echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;rss version=&quot;2.0&quot;&gt;
&lt;channel&gt;
&lt;link&gt;http://www.yourwebsite.com&lt;/link&gt;
&lt;language&gt;en-us&lt;/language&gt;
&lt;copyright&gt;Copyright (C) 2011 yourwebsite.com&lt;/copyright&gt;
&lt;pubDate&gt;' . date(&quot;D, d M Y H:i:s O&quot;, time()) . '&lt;/pubDate&gt;';
?&gt;
</pre>
<p><strong>yourwebsite.com:</strong> Change this to your website url.<br />
A basic RSS document consists of a channel. Within each channel are items. At minimum, each item requires a title, description and link. In this example, we&#8217;re also going to add a publication date.</p>
<h2>Retrieve Data From The Database</h2>
<p>Here we have simple MySQL query (we take newest articles from <strong>&#8220;mytable&#8221;</strong> table), Copy &amp; Paste the below code under the default headers:</p>
<pre class="brush: php;">
&lt;?php
// selecting data from &quot;mytable&quot;
// mytable = your article table name
$query = @mysql_query(&quot;SELECT * FROM mytable ORDER BY tblID DESC LIMIT 0,10&quot;);
while($row = @mysql_fetch_array($query)){
// [url] = change it to your article title
$title = $row['title'];
// [url] = change it to your article title
$description = $row['description'];
// [url] = change it to your article url
$url = $row['url'];
// [time] = change it to your article date
$date = date(&quot;D, d M Y H:i:s O&quot;, $row['time']);
?&gt;
</pre>
<p><strong>mytable:</strong> Change this to your table name.<br />
<strong>ORDER BY DESC:</strong> This is used for showing the latest articles.<br />
<strong>LIMIT 0,10:</strong> This is used for showing the latest 10 articles.</p>
<h2>Building the Feed, Adding Items Without Thumbnail</h2>
<p>Now we get to the good stuff: Building the actual feed without thumbnail. We&#8217;ll take the code above, and add the following lines.</p>
<pre class="brush: php;">
&lt;?php
echo '&lt;item&gt;';
echo '&lt;title&gt;' . $title . '&lt;/title&gt;';
echo '&lt;description&gt;' . $description . '&lt;/description&gt;';
echo '&lt;link&gt;' . $link . '&lt;/link&gt;';
echo '&lt;guid&gt;' . $link . '&lt;/guid&gt;';
echo '&lt;pubDate&gt;' . $date . '&lt;/pubDate&gt;';
echo '&lt;/item&gt;';
?&gt;
</pre>
<h2>Building the Feed, Adding Items With Thumbnail</h2>
<p>Now we get to the good stuff: Building the actual feed with thumbnail. We&#8217;ll take the code above, and add the following lines.</p>
<pre class="brush: php;">
&lt;?php
echo '&lt;item&gt;';
echo '&lt;title&gt;' . $title . '&lt;/title&gt;';
echo '&lt;description&gt;&lt;![CDATA[&lt;img src=' . $avatar . ' width=60 height=60 hspace=0 vspace=0 border=0 align=left /&gt; ' . $description . ' ]]&gt;&lt;/description&gt;';
echo '&lt;link&gt;' . $link . '&lt;/link&gt;';
echo '&lt;guid&gt;' . $link . '&lt;/guid&gt;';
echo '&lt;pubDate&gt;' . $date . '&lt;/pubDate&gt;';
echo '&lt;/item&gt;';
?&gt;
</pre>
<p><strong>$avatar:</strong> Change this to the article thumbnail url.<br />
<strong>width-height</strong> Write the actula width and height for the thumbnail.</p>
<h2>Closing the tags</h2>
<p>That&#8217;s it we are almost done, just close the <strong>while()</strong> and &lt;<strong>urlset&gt; </strong>tags.</p>
<pre class="brush: php;">
} /// closing the while tag
echo '
&lt;/urlset&gt;';
</pre>
<p>and that&#8217;s it we are finished!</p>
<h2>Putting it all together</h2>
<pre class="brush: php;">
&lt;?php
$host = &quot;localhost&quot;; // host name
$user = &quot;user&quot;; // database user name
$pass = &quot;password&quot;; // database password
$database = &quot;dbname&quot;; // database name
// connecting to database
$connect = @mysql_connect($host,$user,$pass)or die (@mysql_error());
// selecting database
@mysql_select_db($database,$connect) or die (@mysql_error());

header(&quot;Content-Type: text/xml;charset=iso-8859-1&quot;);
echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;rss version=&quot;2.0&quot;&gt;
&lt;channel&gt;
&lt;link&gt;http://www.yourwebsite.com&lt;/link&gt;
&lt;language&gt;en-us&lt;/language&gt;
&lt;copyright&gt;Copyright (C) 2011 yourwebsite.com&lt;/copyright&gt;
&lt;pubDate&gt;' . date(&quot;D, d M Y H:i:s O&quot;, time()) . '&lt;/pubDate&gt;';

// selecting data from &quot;mytable&quot;
// mytable = your article table name
$query = @mysql_query(&quot;SELECT * FROM mytable ORDER BY tblID DESC LIMIT 0,10&quot;);
while($row = @mysql_fetch_array($query)){
// [url] = change it to your article title
$title = $row['title'];
// [url] = change it to your article title
$description = $row['description'];
// [url] = change it to your article url
$url = $row['url'];
// [time] = change it to your article date
$date = date(&quot;D, d M Y H:i:s O&quot;, $row['time']);

echo '&lt;item&gt;';
echo '&lt;title&gt;' . $title . '&lt;/title&gt;';
echo '&lt;description&gt;&lt;![CDATA[&lt;img src=' . $avatar . ' width=60 height=60 hspace=0 vspace=0 border=0 align=left /&gt; ' . $description . ' ]]&gt;&lt;/description&gt;';
echo '&lt;link&gt;' . $link . '&lt;/link&gt;';
echo '&lt;guid&gt;' . $link . '&lt;/guid&gt;';
echo '&lt;pubDate&gt;' . $date . '&lt;/pubDate&gt;';
echo '&lt;/item&gt;';
}
echo '&lt;/urlset&gt;';?&gt;
</pre>
<h2>Lets do a little more</h2>
<p>do you want to change <strong> www.yourwebsite.com/rssfeed.php</strong> to <strong>www.yourwebsite.com/rssfeed.xml</strong>, it is so easy, just add the below code in your <strong>&#8220;.htaccess&#8221;</strong> file:</p>
<pre class="brush: xml;">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteRule (.*)\.xml(.*) $1.php$2 [nocase]
&lt;/IfModule&gt;
</pre>
<p>Once you added the above code in your <strong>&#8220;.htaccess&#8221;</strong> file,  the <strong> www.yourwebsite.com/rssfeed.php</strong> file will be automatically converted into  <strong>www.yourwebsite.com/rssfeed.xml</strong>.</p>
<p>You will have something like this, <a href="http://www.fstutorials.com/feed/php/feed.xml">click here</a></p>
<h2>Feed Validation</h2>
<p>When you’re finished, you should ensure that the script validates in the <a href="http://validator.w3.org/feed/">W3C Feed Validation Service</a></p>
<p>Last but not least you should make the feed available to your users, by placing links and RSS icons on your site.</p>
<p>Another marketing option is to submit the link to <a href="http://feedburner.google.com/">Feedburner</a>. Feedburner can help distributing your feed, and provide subscriber and usage statistics.</p>
<p><strong>do you need any help?  just reply below and we are ready to help you &#8230;&#8230;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/create-an-rss-feed-using-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Google Sitemap in Php and Mysql</title>
		<link>http://www.urphp.com/php-and-mysql-google-sitemap/</link>
		<comments>http://www.urphp.com/php-and-mysql-google-sitemap/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:30:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[google sitemap]]></category>
		<category><![CDATA[php google sitemap]]></category>
		<category><![CDATA[php xml sitemap]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[sitemap]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=323</guid>
		<description><![CDATA[Google Xml Sitemap in Php and Mysql, In this tutorial i will teach you how to create your own Php and Mysql Sitemap for your website.]]></description>
			<content:encoded><![CDATA[<h2>What is Sitemap?</h2>
<p>Sitemaps are a way to tell Google about pages on your site we might not otherwise discover. In its simplest terms, a XML Sitemap—usually called Sitemap, with a capital S—is a list of the pages on your website. Creating and submitting a Sitemap helps make sure that Google knows about all the pages on your site, including URLs that may not be discoverable by Google&#8217;s normal crawling process.</p>
<h2>Sitemaps are particularly helpful if:</h2>
<p>— Your site has dynamic content.<br />
— Your site has pages that aren&#8217;t easily discovered by Googlebot during the crawl process—for example, pages featuring rich AJAX or images.<br />
— Your site is new and has few links to it. (Googlebot crawls the web by following links from one page to another, so if your site isn&#8217;t well linked, it may be hard for us to discover it.)<br />
— Your site has a large archive of content pages that are not well linked to each other, or are not linked at all.</p>
<p>Google doesn&#8217;t guarantee that we&#8217;ll crawl or index all of your URLs. However, we use the data in your Sitemap to learn about your site&#8217;s structure, which will allow us to improve our crawler schedule and do a better job crawling your site in the future. In most cases, webmasters will benefit from Sitemap submission, and in no case will you be penalized for it.</p>
<p>Google adheres to Sitemap Protocol 0.9 as defined by <a href="http://www.sitemaps.org/">sitemaps.org</a>. Sitemaps created for Google using Sitemap Protocol 0.9 are therefore compatible with other search engines that adopt the standards of sitemaps.org.</p>
<h2>File format</h2>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;
        &lt;url&gt;
                &lt;loc&gt;http://example.com/&lt;/loc&gt;
                &lt;lastmod&gt;2006-11-18&lt;/lastmod&gt;
                &lt;changefreq&gt;daily&lt;/changefreq&gt;
                &lt;priority&gt;0.8&lt;/priority&gt;
        &lt;/url&gt;
&lt;/urlset&gt;
</pre>
<h2>Element Definations</h2>
<p><a href="http://en.wikipedia.org/wiki/Google_Sitemap#Element_definitions">Click here to view the full E<strong>lement definitions</strong> detail</a></p>
<h2>Lets Create Php Google Sitemap</h2>
<p>First we have to make our map skeleton with some needed stuff (for example database connection), Create a new <strong>&#8220;sitemap.php&#8221;</strong> file and copy and paste the below code:</p>
<pre class="brush: php;">
$host = &quot;localhost&quot;; // host name
$user = &quot;user&quot;; // database user name
$pass = &quot;password&quot;; // database password
$database = &quot;dbname&quot;; // database name
// connecting to database
$connect = @mysql_connect($host,$user,$pass)or die (@mysql_error());
// selecting database
@mysql_select_db($database,$connect) or die (@mysql_error());
</pre>
<p><strong>$host:</strong> leave it default<br />
<strong>$user:</strong> change it to your database username<br />
<strong>$pass:</strong> change it to your database password<br />
<strong>$database:</strong> change it to your database name</p>
<h2>Creating XML</h2>
<p>Now lets add the default headers to  your <strong>&#8220;sitemap.php&#8221;</strong>, copy and paste the below code under the database connecting and selecting code:</p>
<pre class="brush: php;">
// default header(don't delete)
header(&quot;Content-Type: text/xml;charset=iso-8859-1&quot;);
echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;';
</pre>
<h2>Adding Urls to XML</h2>
<p>Here we have simple MySQL query (we take newest articles url and date from <strong>&#8220;mytable&#8221;</strong> table), Copy &amp; Paste the below code under the default headers:</p>
<pre class="brush: php;">
// selecting data from &quot;mytable&quot;
// mytable = your article table name
$query = @mysql_query(&quot;SELECT * FROM mytable&quot;);

while($row = @mysql_fetch_array($query)){
// [url] = article url
$url = $row['url'];
// [time] = article date
$date = date(&quot;Y-m-d&quot;, $row['time']);

// NO CHANGES BELOW
	echo
    '&lt;url&gt;
     &lt;loc&gt;' . $url .'&lt;/loc&gt;
     &lt;lastmod&gt;'. $date .'&lt;/lastmod&gt;
     &lt;changefreq&gt;daily&lt;/changefreq&gt;
     &lt;priority&gt;0.8&lt;/priority&gt;
     &lt;/url&gt;
    ';
}
echo '&lt;/urlset&gt;';?&gt;
</pre>
<p><strong>$row['url'];</strong> Change this to your article url.<br />
<strong>$row['date'];</strong> Change this to your article date.</p>
<p>and that&#8217;s it we are finished!</p>
<h2>Putting it all together</h2>
<pre class="brush: php;">
&lt;?php
$host = &quot;localhost&quot;; // host name
$user = &quot;user&quot;; // database user name
$pass = &quot;password&quot;; // database password
$database = &quot;dbname&quot;; // database name
// connecting to database
$connect = @mysql_connect($host,$user,$pass)or die (@mysql_error());
// selecting database
@mysql_select_db($database,$connect) or die (@mysql_error());

// default header(don't delete)
header(&quot;Content-Type: text/xml;charset=iso-8859-1&quot;);
	echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
	&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;';

// mytable = your content table name
$query = @mysql_query(&quot;SELECT * FROM mytable&quot;);
while($row = @mysql_fetch_array($query)){
// [url] = content url
$url = $row['url'];
// [time] = content date
$date = date(&quot;Y-m-d&quot;, $row['time']);

// NO CHANGES BELOW
	echo
    '&lt;url&gt;
     &lt;loc&gt;' . $url .'&lt;/loc&gt;
     &lt;lastmod&gt;'. $date .'&lt;/lastmod&gt;
     &lt;changefreq&gt;daily&lt;/changefreq&gt;
     &lt;priority&gt;0.8&lt;/priority&gt;
     &lt;/url&gt;
    ';
}
	echo '&lt;/urlset&gt;';?&gt;
</pre>
<h2>Lets do a little more</h2>
<p>do you want to change <strong> www.yourwebsite.com/sitemap.php</strong> to <strong>www.yourwebsite.com/sitemap.xml</strong>, it is so easy, just add the below code in your <strong>&#8220;.htaccess&#8221;</strong> file:</p>
<pre class="brush: xml;">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteRule (.*)\.xml(.*) $1.php$2 [nocase]
&lt;/IfModule&gt;
</pre>
<p>Once you added the above code in your <strong>&#8220;.htaccess&#8221;</strong> file,  the <strong> www.yourwebsite.com/sitemap.php</strong> file will be automatically converted into  <strong>www.yourwebsite.com/sitemap.xml</strong>.</p>
<p>You will have something like this, <a href="http://www.fstutorials.com/sitemaps/php/sitemap.xml">click here</a></p>
<p>do you need any help?  just reply below and we are ready to help you &#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/php-and-mysql-google-sitemap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recently Added Posts in WordPress Without a Plugin</title>
		<link>http://www.urphp.com/recently-added-posts-in-wordpress-without-a-plugin/</link>
		<comments>http://www.urphp.com/recently-added-posts-in-wordpress-without-a-plugin/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 17:31:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[recently added]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress without plugin]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=245</guid>
		<description><![CDATA[In this tutorial i will teach you how to Show Recently Added Post with Thumbnail in WordPress Without a Plugin, this is very easy tutorial, this problem will be solved within a few lines code…]]></description>
			<content:encoded><![CDATA[<h2>The Beginning</h2>
<p>First of all open your <strong>&#8220;single.php&#8221;</strong> file from your theme folder.</p>
<h3>Creating Codings</h3>
<p>Copy &#038; Paste the below code where you want to show the Most Commented Posts.</p>
<pre class="brush: php;">
&lt;div id=&quot;relatedpost&quot;&gt;
&lt;?php
// showposts = show how much recently added post? default is 10.
$recent = new WP_Query('showposts=10'); ?&gt;
&lt;h2&gt;Recently Added Post&lt;/h2&gt;
&lt;?php while ($recent-&gt;have_posts()) : $recent-&gt;the_post();
$avatar = get_post_meta($post-&gt;ID, 'thumbnail', true); /// &lt;-thumbnail is the name of a custom field ?&gt;
&lt;div class=&quot;relatedpost&quot;&gt;
&lt;div class=&quot;avatar&quot;&gt;&lt;img src=&quot;&lt;?php echo $avatar; ?&gt;&quot; width=&quot;60&quot; height=&quot;60&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;rtitle&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;desc&quot;&gt;&lt;?php the_excerpt();?&gt;&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;?php endwhile; ?&gt;
&lt;/div&gt;
</pre>
<h3>Understanding $avatar = get_post_meta($post->ID, &#8216;thumbnail&#8217;, true);</h3>
<p>&#8216;thumbnail&#8217; is the name of a Custom Field, in which we save the url of the avatar look at the below example:<br />
<img alt="Example" src="/wp-content/images/most-commented-ex1.gif" title="Example" class="alignnone" width="536" height="171" /></p>
<h3>Creating Css Style</h3>
<p>Now open your theme <strong>&#8220;stylesheet(style.css)&#8221;</strong> and Copy &#038; Paste the below css code in the stylesheet.</p>
<pre class="brush: css;">
#relatedpost {
	background-color:#FFF;
}
#relatedpost .relatedpost{
	margin:4px;
	padding-bottom: 5px;
	border-bottom:1px dotted #CCC;
	margin-bottom:8px;
	margin-top:5px;
}
#relatedpost .avatar{
	float: left;
	margin-right:6px;
    border: 2px solid #C9C9C9;
}
#relatedpost .rtitle{
	font-size:16px;
	color: #333;
	font-weight:bold;
	letter-spacing:0px;
	line-height:16px;
	padding-top:1px;
}
#relatedpost .desc{
	font-size:12px;
	line-height:19px;
	color: #666;
}
</pre>
<p>Thats it we are finished!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/recently-added-posts-in-wordpress-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most Commented Post in WordPress Without Plugin</title>
		<link>http://www.urphp.com/most-commented-post-in-wordpress-without-plugin/</link>
		<comments>http://www.urphp.com/most-commented-post-in-wordpress-without-plugin/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 17:02:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[most commented]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress without plugin]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=230</guid>
		<description><![CDATA[In this tutorial i will teach you how to Show Most Commented Post with Thumbnail in WordPress Without a Plugin, this is very easy tutorial, this problem will be solved within a few lines code…]]></description>
			<content:encoded><![CDATA[<h2>The Beginning</h2>
<p>First of all open your <strong>&#8220;single.php&#8221;</strong> file from your theme folder.</p>
<h3>Creating Codings</h3>
<p>Copy &#038; Paste the below code where you want to show the Most Commented Posts.</p>
<pre class="brush: php;">
&lt;div id=&quot;relatedpost&quot;&gt;
&lt;?php
// post_per_page = show how much post per page? default is 5.
$popular = new WP_Query('orderby=comment_count&amp;posts_per_page=5'); ?&gt;
&lt;h2&gt;Most Commented Post&lt;/h2&gt;
&lt;?php while ($popular-&gt;have_posts()) : $popular-&gt;the_post();
$avatar = get_post_meta($post-&gt;ID, 'thumbnail', true); /// &lt;-thumbnail is the name of a custom field ?&gt;
&lt;div class=&quot;relatedpost&quot;&gt;
&lt;div class=&quot;avatar&quot;&gt;&lt;img src=&quot;&lt;?php echo $avatar; ?&gt;&quot; width=&quot;60&quot; height=&quot;60&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;rtitle&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;desc&quot;&gt;&lt;?php the_excerpt();?&gt;&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;?php endwhile; ?&gt;
&lt;/div&gt;
</pre>
<h3>Understanding $avatar = get_post_meta($post->ID, &#8216;thumbnail&#8217;, true);</h3>
<p>&#8216;thumbnail&#8217; is the name of a Custom Field, in which we save the url of the avatar look at the below example:<br />
<img alt="Example" src="/wp-content/images/most-commented-ex1.gif" title="Example" class="alignnone" width="536" height="171" /></p>
<h3>Creating Css Style</h3>
<p>Now open your theme <strong>&#8220;stylesheet(style.css)&#8221;</strong> and Copy &#038; Paste the below css code in the stylesheet.</p>
<pre class="brush: css;">
#relatedpost {
	background-color:#FFF;
}
#relatedpost .relatedpost{
	margin:4px;
	padding-bottom: 5px;
	border-bottom:1px dotted #CCC;
	margin-bottom:8px;
	margin-top:5px;
}
#relatedpost .avatar{
	float: left;
	margin-right:6px;
    border: 2px solid #C9C9C9;
}
#relatedpost .rtitle{
	font-size:16px;
	color: #333;
	font-weight:bold;
	letter-spacing:0px;
	line-height:16px;
	padding-top:1px;
}
#relatedpost .desc{
	font-size:12px;
	line-height:19px;
	color: #666;
}
</pre>
<p>Thats it we are finished!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/most-commented-post-in-wordpress-without-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Related Post With Thumbnail in WordPress Without a Plugin</title>
		<link>http://www.urphp.com/show-related-post-with-thumbnail-in-wordpress-without-a-plugin/</link>
		<comments>http://www.urphp.com/show-related-post-with-thumbnail-in-wordpress-without-a-plugin/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 10:26:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[related post]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress without plugin]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=222</guid>
		<description><![CDATA[In this tutorial i will teach you how to Show Related Post with Related Thumbnail in WordPress Without a Plugin, this is very easy tutorial, this problem will be solved within a few lines code...]]></description>
			<content:encoded><![CDATA[<h2>The Beginning</h2>
<p>First of all open your <strong>&#8220;single.php&#8221;</strong> file from your theme folder.</p>
<h3>Creating Codings</h3>
<p>Copy &#038; Paste the below code where you want to show the Related Posts.</p>
<pre class="brush: php;">
&lt;div id=&quot;relatedpost&quot;&gt;
&lt;?php
$backup = $post;
$tags = wp_get_post_tags($post-&gt;ID);

if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id;

$args=array(
'tag__in' =&gt; $tag_ids, // get related post by related tags
'post__not_in' =&gt; array($post-&gt;ID),
'showposts'=&gt;5, // Number of Related Posts
'caller_get_posts'=&gt;1);
$my_query = new wp_query($args);

if( $my_query-&gt;have_posts() ) { echo &quot;&lt;h2&gt;Related Posts&lt;/h2&gt;&quot;; //// Show the Related Post Heading
while ($my_query-&gt;have_posts()) {
$my_query-&gt;the_post();
$avatar = get_post_meta($post-&gt;ID, 'thumbnail', true); /// &lt;-thumbnail is the name of a custom field ?&gt;

&lt;div class=&quot;relatedpost&quot;&gt;
&lt;div class=&quot;avatar&quot;&gt;&lt;img src=&quot;&lt;?php echo $avatar; ?&gt;&quot; width=&quot;60&quot; height=&quot;60&quot; alt=&quot;Final Image&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;rtitle&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;desc&quot;&gt;&lt;?php the_excerpt();?&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;?php }}} $post = $backup;	wp_reset_query();?&gt;
&lt;/div&gt;
</pre>
<h3>Understanding $avatar = get_post_meta($post->ID, &#8216;thumbnail&#8217;, true);</h3>
<p>&#8216;thumbnail&#8217; is the name of a Custom Field, in which we save the url of the avatar look at the below example:<br />
<img alt="Example" src="/wp-content/images/most-commented-ex1.gif" title="Example" class="alignnone" width="536" height="171" /></p>
<h3>Creating Css Style</h3>
<p>Now open your theme <strong>&#8220;stylesheet(style.css)&#8221;</strong> and Copy &#038; Paste the below css code in the stylesheet.</p>
<pre class="brush: css;">
#relatedpost {
	background-color:#FFF;
}
#relatedpost .relatedpost{
	margin:4px;
	padding-bottom: 5px;
	border-bottom:1px dotted #CCC;
	margin-bottom:8px;
	margin-top:5px;
}
#relatedpost .avatar{
	float: left;
	margin-right:6px;
    border: 2px solid #C9C9C9;
}
#relatedpost .rtitle{
	font-size:16px;
	color: #333;
	font-weight:bold;
	letter-spacing:0px;
	line-height:16px;
	padding-top:1px;
}
#relatedpost .desc{
	font-size:12px;
	line-height:19px;
	color: #666;
}
</pre>
<p>Thats it we are finished!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/show-related-post-with-thumbnail-in-wordpress-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Content Management System</title>
		<link>http://www.urphp.com/simple-content-management-system/</link>
		<comments>http://www.urphp.com/simple-content-management-system/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 18:56:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Content Management System]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[content management system]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://www.urphp.com/?p=162</guid>
		<description><![CDATA[In this tutorial i will teach you how to create a simple content management system in php, you will also learn how to add data to mysql and how to edit or delete data from mysql...]]></description>
			<content:encoded><![CDATA[<h2>The Beginning</h2>
<p>First of all we are create a database in MySql</p>
<h3>Creating MySql Database</h3>
<p>Creating a new database <strong>“cms”</strong> (if not exist):</p>
<pre class="brush: xml;">CREATE DATABASE mydb</pre>
<h3>Creating Tables</h3>
<p>Creating a new table “posts”:</p>
<pre class="brush: xml;">
CREATE TABLE IF NOT EXISTS `posts` (
  `postID` int(11) NOT NULL AUTO_INCREMENT,
  `postName` varchar(225) NOT NULL,
  `postDate` int(11) NOT NULL,
  `postDetail` text NOT NULL,
  `postUser` varchar(225) NOT NULL,
  PRIMARY KEY (`postID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1
</pre>
<h2>Admin Area</h2>
<p>Now lets create the admin area first, create a new folder <strong>&#8216;admincp&#8217;</strong> and then create a new <strong>&#8216;index.php&#8217;</strong> file in the admincp folder and Copy &amp; Paste the below code.</p>
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Simple Content Management System&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Welcome to Admin Area&lt;/h2&gt;
&lt;a href=&quot;/admincp/write-post.php&quot;&gt;&lt;strong&gt;Write Post&lt;/strong&gt;&lt;/a&gt; | &lt;a href=&quot;/admincp/manage-post.php&quot;&gt;&lt;strong&gt;Manage Post&lt;/strong&gt;&lt;/a&gt;
&lt;hr /&gt;
A Simple Content Management System - Admin Area
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>Creating Forms</h3>
<p>Now create a new <strong>&#8216;write-post.php&#8217;</strong> file in the admincp folder and Copy &amp; Paste the below code:</p>
<pre class="brush: xml;">
&lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;p&gt;Post Name:&lt;br /&gt;
  &lt;input name=&quot;postName&quot; type=&quot;text&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Author:&lt;br /&gt;
    &lt;input name=&quot;postUser&quot; type=&quot;text&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Details:&lt;br /&gt;
    &lt;textarea name=&quot;postDetail&quot; cols=&quot;40&quot; rows=&quot;15&quot;&gt;&lt;/textarea&gt;
  &lt;/p&gt;
  &lt;input name=&quot;post&quot; type=&quot;submit&quot; value=&quot;Write Post&quot; /&gt;
&lt;/form&gt;
</pre>
<h3>Creating Codings</h3>
<p>Copy &amp; Paste the below code in the <strong>&#8216;write-post.php&#8217;</strong>:</p>
<pre class="brush: php;">
&lt;?php
//////// Connecting and selecting mysql database
$host = &quot;localhost&quot;;  /// use default
$username = &quot;user&quot;; /// write your mysql username
$password = &quot;pass&quot;; /// write your mysql password
$database = &quot;cms&quot;; /// write your mysql database
$connect = @mysql_connect($host, $username, $password) or die (@mysql_error());
$selectdb = @mysql_select_db($database, $connect) or die (@mysql_error());

//////// inserting forms data in mysql database
if(isset($_POST['post'])){
	$postName = $_POST['postName']; /// post name
	$postUser = $_POST['postUser']; /// post author
	$postDetail = $_POST['postDetail']; /// post details
	$postDate = time();  /// post timestamp
	///// checking empty fields
	if(empty($postName) OR empty($postUser) OR empty($postDetail)){
		echo &quot;Sorry, You must fill all the forms!&quot;;
	}else{
	//// inserting data in mysql database
	$data = @mysql_query(&quot;INSERT INTO posts SET postName='$postName', postUser='$postUser', postDetail='$postDetail', postDate='$postDate'&quot;) or die(@mysql_error());

	if($data){echo &quot;Post submitted succesfully&quot;;} /// &lt;&lt; if data submitted, then show this message
	}
}
?&gt;
</pre>
<h3>Putting it all together (write-post.php)</h3>
<pre class="brush: plain;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Simple Content Management System - Write Post&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Simple Content Management System - Admin Area&lt;/h2&gt;
&lt;a href=&quot;/admincp/write-post.php&quot;&gt;&lt;strong&gt;&lt;em&gt;Write Post&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; | &lt;a href=&quot;/admincp/manage-post.php&quot;&gt;&lt;strong&gt;Manage Post&lt;/strong&gt;&lt;/a&gt;
&lt;hr /&gt;
&lt;h2&gt;Write Post&lt;/h2&gt;
&lt;?php
//////// Connecting and selecting mysql database
$host = &quot;localhost&quot;;  /// use default
$username = &quot;root&quot;; /// write your mysql username
$password = &quot;&quot;; /// write your mysql password
$database = &quot;cms&quot;; /// write your mysql database
$connect = @mysql_connect($host, $username, $password) or die (@mysql_error());
$selectdb = @mysql_select_db($database, $connect) or die (@mysql_error());

//////// inserting forms data in mysql database
if(isset($_POST['post'])){
	$postName = $_POST['postName']; /// post name
	$postUser = $_POST['postUser']; /// post author
	$postDetail = $_POST['postDetail']; /// post details
	$postDate = time();  /// post timestamp
	///// checking empty fields
	if(empty($postName) OR empty($postUser) OR empty($postDetail)){
		echo &quot;Sorry, You must fill all the forms!&quot;;
	}else{
		//// inserting data in mysql database
		$data = @mysql_query(&quot;INSERT INTO posts SET postName='$postName', postUser='$postUser', postDetail='$postDetail', postDate='$postDate'&quot;) or die(@mysql_error());

		if($data){echo &quot;Post submitted succesfully&quot;;} /// &lt;&lt; if data submitted, then show this message
	}
}
?&gt;
&lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;p&gt;Post Name:&lt;br /&gt;
  &lt;input name=&quot;postName&quot; type=&quot;text&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Author:&lt;br /&gt;
    &lt;input name=&quot;postUser&quot; type=&quot;text&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Details:&lt;br /&gt;
    &lt;textarea name=&quot;postDetail&quot; cols=&quot;40&quot; rows=&quot;15&quot;&gt;&lt;/textarea&gt;
  &lt;/p&gt;
  &lt;input name=&quot;post&quot; type=&quot;submit&quot; value=&quot;Write Post&quot; /&gt;
&lt;/form&gt;
&lt;hr /&gt;
A Simple Content Management System - Admin Area
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Managing Posts</h2>
<p>Now lets create <strong>&#8220;manage-post.php&#8221;</strong> file.</p>
<h3>Showing MySql Data</h3>
<p>Showing mysql data in <strong>&#8220;manage-post.php&#8221;</strong>.</p>
<h3>Creating Code</h3>
<p>Copy &amp; Paste the below code in the<strong> &#8220;manage-post.php&#8221;</strong></p>
<pre class="brush: php;">
&lt;?php
//////// Connecting and selecting mysql database
$host = &quot;localhost&quot;;  /// use default
$username = &quot;user&quot;; /// write your mysql username
$password = &quot;pass&quot;; /// write your mysql password
$database = &quot;cms&quot;; /// write your mysql database
$connect = @mysql_connect($host, $username, $password) or die (@mysql_error());
$selectdb = @mysql_select_db($database, $connect) or die (@mysql_error());

$selectPosts = @mysql_query(&quot;SELECT * FROM posts ORDER BY postName ASC&quot;); /// selecting all posts from mysql database

while($showpost = @mysql_fetch_array($selectPosts)){ //// showing mysql data ?&gt;

&lt;?php echo $showpost['postName'];?&gt; - &lt;a href=&quot;?action=edit&amp;ID=&lt;?php echo $showpost['postID'];?&gt;&quot;&gt;Edit&lt;/a&gt; - &lt;a href=&quot;?action=delete&amp;ID=&lt;?php echo $showpost['postID'];?&gt;&quot;&gt;Delete&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;?php }?&gt;
</pre>
<h3>Editing a Post</h3>
<p>If some click on the <strong>&#8220;Edit&#8221;</strong> link, then edit the post&#8230;<br />
<img class="alignnone" title="Example" src="http://www.urphp.com/wp-content/images/simple-content-management-system-ex1.gif" alt="Example" width="467" height="131" /></p>
<h3>Creating Coding</h3>
<p>Copy and Paste the below code <strong>&#8220;manage-post.php&#8221;</strong>.</p>
<pre class="brush: php;">
&lt;?php
if(isset($_POST['update'])){ /// if button submitted
$postName = $_POST['postName']; // get the post name
$postUser = $_POST['postUser']; // get the post user
$postDetail = $_POST['postDetail']; // get the post detail
$postID = $_POST['postID']; // get the post id
/// update the forms data in the mysql database
 $data = @mysql_query(&quot;UPDATE posts SET postName='$postName', postUser='$postUser', postDetail='$postDetail' WHERE postID='$postID'&quot;) or die(@mysql_error());
/// if data submitted to database
 if($data){echo &quot;  &amp;#8212;  Post updated succesfully, click here to &lt;a href='/admincp/manage-post.php?refresh'&gt;refresh&lt;/a&gt;&quot;;}
}

$action = $_GET['action']; /// get the action from the url, for example ?action=edit or ?action=delete
$ID = $_GET['ID']; /// get the post id from the url

 if($action == &quot;edit&quot;){ /// if some click on the &quot;Edit&quot; link then edit that link.
 $selectPost = @mysql_fetch_array(@mysql_query(&quot;SELECT * FROM posts WHERE postID='$ID'&quot;)); /// select all the data of editted post from the database ?&gt;

 &lt;h2&gt;Manage '&lt;?php echo $selectPost['postName'];?&gt;' Post&lt;/h2&gt;
 &lt;form action=&quot;/admincp/manage-post.php&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;p&gt;Post Name:&lt;br /&gt;&lt;input name=&quot;postID&quot; type=&quot;hidden&quot; value=&quot;&lt;?php echo $selectPost['postID'];?&gt;&quot; /&gt;
  &lt;input name=&quot;postName&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $selectPost['postName'];?&gt;&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Author:&lt;br /&gt;
    &lt;input name=&quot;postUser&quot; type=&quot;text&quot;value=&quot;&lt;?php echo $selectPost['postUser'];?&gt;&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Details:&lt;br /&gt;
    &lt;textarea name=&quot;postDetail&quot; cols=&quot;40&quot; rows=&quot;15&quot;&gt;&lt;?php echo $selectPost['postDetail'];?&gt;&lt;/textarea&gt;
  &lt;/p&gt;
  &lt;input name=&quot;update&quot; type=&quot;submit&quot; value=&quot;Update Post&quot; /&gt;
&lt;/form&gt;

   &lt;?php }?&gt;
</pre>
<h3>Deleting a Post</h3>
<p>If some click on the <strong>&#8220;Delete&#8221;</strong> link, then delete the post&#8230;<br />
<img title="Example" src="http://www.urphp.com/wp-content/images/simple-content-management-system-ex2.gif" alt="Example" width="467" height="131" /></p>
<h3>Creating Coding</h3>
<p>Copy and Paste the below code <strong>&#8220;manage-post.php&#8221;</strong>.</p>
<pre class="brush: php;">
&lt;?php
if(isset($_POST['yes'])){ /// if button submitted
	$postID = $_POST['postID']; // get the post id
	/// delete the data from the mysql databse
		$data = @mysql_query(&quot;DELETE FROM posts WHERE postID='$postID'&quot;) or die(@mysql_error());
	/// if data deleted from the database
		if($data){echo &quot;  &amp;#8212;  Post Deleted succesfully, click here to &lt;a href='/admincp/manage-post.php?refresh'&gt;refresh&lt;/a&gt;&quot;;}
}
$action = $_GET['action']; /// get the action from the url, for example ?action=edit or ?action=delete
$ID = $_GET['ID']; /// get the post id from the url
?&gt;

&lt;?php if($action == &quot;delete&quot;){/// if some on click on the &quot;Delete&quot; link then delete that link.
$selectPost = @mysql_fetch_array(@mysql_query(&quot;SELECT * FROM posts WHERE postID='$postID'&quot;));  /// select all the data of the post from the database ?&gt;
Are you sure to delete '&lt;?php echo $selectPost['postName'];?&gt;'?&lt;br /&gt;
&lt;form action=&quot;/admincp/manage-post.php&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;input name=&quot;postID&quot; type=&quot;hidden&quot; value=&quot;&lt;?php echo $selectPost['postID'];?&gt;&quot; /&gt;
  &lt;input name=&quot;yes&quot; type=&quot;submit&quot; value=&quot;Yes&quot; /&gt; &lt;input name=&quot;No&quot; ONCLICK=&quot;history.go(-1)&quot; type=&quot;button&quot; value=&quot;No&quot; /&gt;
&lt;/form&gt;
&lt;?php }?&gt;
</pre>
<h3>Putting it All Together (manage-post.php)</h3>
<pre class="brush: plain;">
&lt;?php
//////// Connecting and selecting mysql database
$host = &quot;localhost&quot;;  /// use default
$username = &quot;user&quot;; /// write your mysql username
$password = &quot;pass&quot;; /// write your mysql password
$database = &quot;cms&quot;; /// write your mysql database
$connect = @mysql_connect($host, $username, $password) or die (@mysql_error());
$selectdb = @mysql_select_db($database, $connect) or die (@mysql_error());?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Simple Content Management System - Manage Post&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Simple Content Management System - Admin Area&lt;/h2&gt;
&lt;a href=&quot;/admincp/write-post.php&quot;&gt;&lt;strong&gt;Write Post&lt;/strong&gt;&lt;/a&gt; | &lt;a href=&quot;/admincp/manage-post.php&quot;&gt;&lt;strong&gt;&lt;em&gt;Manage Post&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;hr /&gt;
&lt;?php
if(isset($_POST['yes'])){ /// if yes button submitted
	$postID = $_POST['postID']; // get the post id
	/// delete the data from the mysql databse
		$data = @mysql_query(&quot;DELETE FROM posts WHERE postID='$postID'&quot;) or die(@mysql_error());
	/// if data deleted from the database
		if($data){echo &quot;  &amp;#8212;  Post Deleted succesfully, click here to &lt;a href='/admincp/manage-post.php?refresh'&gt;refresh&lt;/a&gt;&quot;;}
}
$action = $_GET['action']; /// get the action from the url, for example ?action=edit or ?action=delete
$ID = $_GET['ID']; /// get the post id from the url
?&gt;

&lt;?php if($action == &quot;delete&quot;){/// if some on click on the &quot;Edit&quot; link then edit that link.
$selectPost = @mysql_fetch_array(@mysql_query(&quot;SELECT * FROM posts WHERE postID='$ID'&quot;));  /// select all the data of the post from the database ?&gt;
Are you sure to delete '&lt;?php echo $selectPost['postName'];?&gt;'?&lt;br /&gt;
&lt;form action=&quot;/admincp/manage-post.php&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;input name=&quot;postID&quot; type=&quot;hidden&quot; value=&quot;&lt;?php echo $selectPost['postID'];?&gt;&quot; /&gt;
  &lt;input name=&quot;yes&quot; type=&quot;submit&quot; value=&quot;Yes&quot; /&gt; &lt;input name=&quot;No&quot; ONCLICK=&quot;history.go(-1)&quot; type=&quot;button&quot; value=&quot;No&quot; /&gt;
&lt;/form&gt;
&lt;?php }else{?&gt;

&lt;?php
if(isset($_POST['update'])){ /// if button submitted
	$postName = $_POST['postName']; // get the post name
	$postUser = $_POST['postUser']; // get the post user
	$postDetail = $_POST['postDetail']; // get the post detail
	$postID = $_POST['postID']; // get the post id
	/// update the forms data in the mysql databse
	$data = @mysql_query(&quot;UPDATE posts SET postName='$postName', postUser='$postUser', postDetail='$postDetail' WHERE postID='$postID'&quot;) or die(@mysql_error());
	/// if data submitted to database
	if($data){echo &quot;  &amp;#8212;  Post updated succesfully, click here to &lt;a href='/admincp/manage-post.php?refresh'&gt;refresh&lt;/a&gt;&quot;;}
}
?&gt;
&lt;?php
$action = $_GET['action']; /// get the action from the url, for example ?action=edit or ?action=delete
$ID = $_GET['ID']; /// get the post id from the url
 if($action == &quot;edit&quot;){ /// if some one click on the &quot;Edit&quot; link then edit that link.
 $selectPost = @mysql_fetch_array(@mysql_query(&quot;SELECT * FROM posts WHERE postID='$ID'&quot;)); /// select all the data of editted post from the database ?&gt;
 &lt;h2&gt;Manage '&lt;?php echo $selectPost['postName'];?&gt;' Post&lt;/h2&gt;
 &lt;form action=&quot;/admincp/manage-post.php&quot; method=&quot;post&quot; name=&quot;post&quot;&gt;
  &lt;p&gt;Post Name:&lt;br /&gt;&lt;input name=&quot;postID&quot; type=&quot;hidden&quot; value=&quot;&lt;?php echo $selectPost['postID'];?&gt;&quot; /&gt;
  &lt;input name=&quot;postName&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $selectPost['postName'];?&gt;&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Author:&lt;br /&gt;
    &lt;input name=&quot;postUser&quot; type=&quot;text&quot;value=&quot;&lt;?php echo $selectPost['postUser'];?&gt;&quot; size=&quot;45&quot; /&gt;
  &lt;/p&gt;
  &lt;p&gt;Post Details:&lt;br /&gt;
    &lt;textarea name=&quot;postDetail&quot; cols=&quot;40&quot; rows=&quot;15&quot;&gt;&lt;?php echo $selectPost['postDetail'];?&gt;&lt;/textarea&gt;
  &lt;/p&gt;
  &lt;input name=&quot;update&quot; type=&quot;submit&quot; value=&quot;Update Post&quot; /&gt;
&lt;/form&gt;
   &lt;?php }else{ ?&gt;
&lt;h2&gt;Manage Posts&lt;/h2&gt;
&lt;?php
$selectPosts = @mysql_query(&quot;SELECT * FROM posts ORDER BY postName ASC&quot;); /// selecting all posts from mysql databae
while($showpost = @mysql_fetch_array($selectPosts)){ //// showing mysql data ?&gt;
&lt;?php echo $showpost['postName'];?&gt; &amp;#8212; &lt;a href=&quot;?action=edit&amp;ID=&lt;?php echo $showpost['postID'];?&gt;&quot;&gt;Edit&lt;/a&gt; &amp;#8212; &lt;a href=&quot;?action=delete&amp;ID=&lt;?php echo $showpost['postID'];?&gt;&quot;&gt;Delete&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;?php }?&gt;
&lt;?php }} ?&gt;
&lt;hr /&gt;
A Simple Content Management System - Admin Area
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>We are 85% done</h2>
<p>Now lets show the posts from the sql database on the main page (eg: in root folder), create a new <strong>&#8220;index.php&#8221;</strong> file in the root folder.</p>
<h3>Creating Codings</h3>
<p>Copy &amp; Paste the below code in <strong>&#8220;index.php&#8221;</strong> file.</p>
<pre class="brush: php;">
&lt;?php
$host = &quot;localhost&quot;;  /// use default
$username = &quot;username&quot;; /// write your mysql username
$password = &quot;password&quot;; /// write your mysql password
$database = &quot;cms&quot;; /// write your mysql database
$connect = @mysql_connect($host, $username, $password) or die (@mysql_error());
$selectdb = @mysql_select_db($database, $connect) or die (@mysql_error());
/// selecting all posts from mysql database
$selectPosts = @mysql_query(&quot;SELECT * FROM posts ORDER BY postName ASC&quot;);
//// showing mysql data
while($showpost = @mysql_fetch_array($selectPosts)){  ?&gt;
&lt;?php echo $showpost['postName'];?&gt;&lt;br /&gt;
&lt;?php }?&gt;
</pre>
<p>That&#8217;s it we are finished!</p>
<h3>Download Available</h3>
<p><a href="http://www.urphp.com/wp-content/download/simple-content-management/download.rar" target="_blank">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.urphp.com/simple-content-management-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
