<?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 genious &#187; Uncategorized</title>
	<atom:link href="http://www.phpgenious.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpgenious.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Sep 2011 21:02:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Some Inspirational Thoughts From Some Genious Persons</title>
		<link>http://www.phpgenious.com/2009/02/some-inspirational-thoughts-from-some-genious-persons/</link>
		<comments>http://www.phpgenious.com/2009/02/some-inspirational-thoughts-from-some-genious-persons/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 14:42:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Greate thoughts]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=185</guid>
		<description><![CDATA[Hello Friends !! Today i will show you some Inspirational Thoughts From Some Genious Persons of world. When your mind have negative thinking, then please revise these thoughts in your [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends !!</p>
<p>Today i will show you some Inspirational Thoughts From Some Genious Persons of world.</p>
<p>When your mind have negative thinking, then please revise these thoughts in your mind :</p>
<blockquote>
<p align="center">
<p align="center">â€œMan often becomes what he believes himself to be. If I keep on saying to myself that I cannot do a certain thing, it is possible that I may end by really becoming incapable of doing it. On the contrary, if I have the belief that I can do it, I shall surely acquire the capacity to do it even if I may not have it at the beginning.â€<br />
- <em><strong>Mahatma Gandhi</strong></em></p>
<p align="center">
<p align="center">â€œYou can never cross the ocean unless you have the courage to lose sight of the shore.â€<br />
- <em><strong>Christopher Columbus</strong></em></p>
<p align="center">
<p align="center">â€œTo a brave man, good and bad luck are like his left and right hand. He uses both.â€<br />
- <em><strong>St Catherine of Siena</strong></em></p>
<p align="center">
<p align="center">â€œWhen one door of happiness closes, another opens, but often we took so long at the closed door that we do not see the one that has been opened up for usâ€<br />
- <em><strong>Helen Keller</strong></em></p>
<p align="center">
<p align="center">â€œWe donâ€™t see the things the way they are. We see things the way WE are.â€<br />
- <em><strong>Talmund</strong></em></p>
<p align="center">
<p align="center">â€œFormal education will make you a living. Self education will make you a fortune.â€<br />
- <em><strong>Jim Rohn</strong></em></p>
<p align="center">
<p align="center">â€œIt isnâ€™t what the book costs. Itâ€™s what it will cost you if you donâ€™t read it.â€<br />
- <em><strong>Jim Rohn</strong></em></p>
<p align="center">
<p align="center">â€œYou must be the change you want to see in the world.â€<br />
- <em><strong>Mahatma Gandhi</strong></em><em> </em></p>
<p align="center">
<p align="center">â€œThe future has several names. For the weak, it is the impossible. For the fainthearted, it is the unknown. For the thoughtful and valiant, it is the ideal.â€<br />
- <em><strong>Victor Hugo</strong></em></p>
<p align="center">
<p align="center">â€œThere is nothing more genuine than breaking away from the chorus to learn the sound of your own voice.â€<br />
- <em><strong>Po Bronson</strong></em></p>
<p align="center">
<p align="center">â€œDo not go where the path may lead, go instead where there is no path and leave a trail.â€<br />
- <em><strong>Waldo Emerson</strong></em></p>
<p align="center">
<p align="center">â€œUse what talents you possess, the woods will be very silent if no birds sang there except those that sang best.â€<br />
- <em><strong>Henry van Dyke</strong></em></p>
<p align="center">
<p align="center">â€œDo not fear to be eccentric in opinion, for every opinion now accepted was once eccentric.â€<br />
- <em><strong>Bertrand Russell</strong></em></p>
<p align="center">
</blockquote>
<p><span id="more-185"></span></p>
<p>Some more thoughts :</p>
<blockquote>
<p align="center">â€œHistory will be kind to me, for I intend to write it.â€<br />
- <em><strong>Winston Churchill</strong></em></p>
<p align="center">
<p align="center">â€œLife isnâ€™t about finding yourself. Lifeâ€™s about creating yourself.â€<br />
- <em><strong>George Bernard Shaw</strong></em></p>
<p align="center">
<p align="center">â€œLive your life each day as you would climb a mountain. An occasional glance towards the summit keeps the goal in mind, but many beautiful scenes are to be observed from each new vintage point.â€<br />
- <em><strong>Harold B Melchart</strong></em></p>
<p align="center">
<p align="center">â€œThe tragedy of life doesnâ€™t lie in not reaching your goal. The tragedy lies in having no goals to reach.â€<br />
- <em><strong>Benjamin Mays</strong></em></p>
<p align="center">
<p align="center">â€œMore often in life, we end up regretting the chances in life that we had, but didnâ€™t take them, than those chances that we took and wished we hadnâ€™t.â€<br />
- <em><strong>Anonymous</strong></em></p>
<p align="center">
<p align="center">â€œAn excuse is worse and more terrible than a lie, for an excuse is a lie guarded.â€<br />
- <em><strong>Pope John Paul I</strong></em></p>
<p align="center">
<p align="center">â€œDonâ€™t wish it were easier, wish you were better. Donâ€™t wish for fewer problems, wish for more skills. Donâ€™t wish for less challenges, wish for more wisdom.â€<br />
- <em><strong>Earl Shoaf</strong></em></p>
<p align="center">
<p align="center">â€œEvery problem has in it the seeds of its own solution. If you donâ€™t have any problems, you donâ€™t get any seeds.â€<br />
- <em><strong>Norman Vincent Peale</strong></em></p>
<p align="center">
<p align="center">â€œIf you change the way you look at things, the things you look at change.â€<br />
- <em><strong>Dr Wayne Dyer</strong></em></p>
<p align="center">
<p align="center">â€œThe problem is not that there are problems. The problem is expecting otherwise and thinking that having problems is a problem.â€<br />
- <em><strong>Theodore Rubin</strong></em></p>
<p align="center">
<p align="center">â€œPessimist : A person who says that O is the last letter of ZERO, instead of the first letter in word OPPORTUNITY.â€<br />
- <em><strong>Anonymous</strong></em></p>
<p align="center">
<p align="center">â€œOpportunity is missed by most people because it is dressed in overalls and looks like work.â€<br />
<em>- </em><em><strong>Thomas A Edison</strong></em></p>
<p align="center">
<p align="center">â€œBlessed are those who can give without remembering and take without forgettingâ€<br />
- <em><strong>Elizabeth Bibesco</strong></em></p>
<p align="center">
<p align="center">â€œYesterday is history, tomorrow is a mystery. And today? Today is a gift. Thatâ€™s why we call it the present.â€<br />
- <em><strong>B. Olatunji</strong></em></p>
<p align="center">
<p align="center">â€œWhen you get to the end of the rope, tie a knot and hang on.â€<br />
- <em><strong>Franklin D Roosevelt</strong></em></p>
<p align="center">
<p align="center">â€œYour attitude, not your aptitude, determines your altitude.â€<br />
- <em><strong>Zig Ziglar</strong></em></p>
<p align="center">
<p align="center">â€œIf youâ€™re going through hell, keep going.â€<br />
- <em><strong>Winston Churchill</strong></em></p>
<p align="center">
<p align="center">â€œThe secret to success is to start from scratch and keep on scratching.â€<br />
- <em><strong>Dennis Green</strong></em></p>
<p align="center">
<p align="center">â€œChampions arenâ€™t made in gyms. Champions are made from something they have deep inside them a desire, a dream, a vision. They have to have the skill and the will. But the will must be stronger than the skill.â€<br />
- <em><strong>Muhammad Ali</strong></em></p>
<p align="center">
<p align="center">â€œMost of the important things in the world have been accomplished by people who have kept on trying when there seemed to be no hope at all.â€<br />
- <em><strong>Dale Carnegie</strong></em></p>
<p align="center">
<p align="center">â€œSo many of our dreams at first seems impossible, then they seem improbable, and then, when we summon the will, they soon become inevitable.â€<br />
- <em><strong>Christopher Reeve</strong></em></p>
<p align="center">
<p align="center">â€œHard work spotlights the character of people. Some turn up their sleeves. Some turn up their noses, and some donâ€™t turn up at all.â€<br />
- <em><strong>Sam Ewing</strong></em></p>
<p align="center">
<p align="center">â€œThere are those who work all day. Those who dream all day. And those who spend an hour dreaming before setting to work to fulfill those dreams. Go into the third category because thereâ€™s virtually no competition.â€<br />
- <em><strong>Steven J Ross</strong></em></p>
<p align="center">
<p align="center">â€œOur greatest glory is not in never falling, but in rising every time we fall.â€<br />
- <em><strong>Confucious</strong></em></p>
<p align="center">
<p align="center">â€œMany of lifeâ€™s failures are people who had not realized how close they were to success when they gave up.â€<br />
- <em><strong>Thomas A Edison</strong></em></p>
<p align="center">
<p align="center">â€œThe main thing is to keep the main thing the main thing.â€<br />
- <em><strong>Stephen Covey</strong></em></p>
<p align="center">
<p align="center">â€œEfficiency is doing things right. Effectiveness is doing the right things.â€<br />
- <em><strong>Peter Drucker</strong></em></p>
<p align="center">
<p align="center">â€œDo you know what happens when you give a procrastinator a good idea? Nothing!â€<br />
- <em><strong>Donald Gardner</strong></em></p>
<p align="center">
<p align="center">â€œSuccess is what you attract by the person you become.â€<br />
- <em><strong>Jim Rohn</strong></em></p>
<p align="center">
<p align="center">â€œYou have to â€˜Beâ€™ before you can â€˜Doâ€™ and â€˜Doâ€™ before you can â€˜Haveâ€™.<br />
- <em><strong>Zig Ziglar</strong></em></p>
<p align="center">
<p align="center">â€œYou can have everything in life that you want if you will just help enough other people to get what they want.â€<br />
- <em><strong>Zig Ziglar</strong></em></p>
<p align="center">
<p align="center">â€œThe test we must set for ourselves is not to march alone but to march in such a way that others wish to join us.â€<br />
- <em><strong>Hubert Humphrey</strong></em></p>
<p align="center">
<p align="center">â€œLots of people want to ride with you in the limo, but what you want is someone who will take the bus when the limo breaks down.â€<br />
- <em><strong>Oprah Winfrey</strong></em></p>
<p align="center">
<p align="center">â€œThink like a man of action, and act like a man of thought.â€<em><br />
- </em><em><strong>Henri L. Bergson</strong></em></p>
<p align="center">
<p align="center">â€œI am only one, but still I am one. I cannot do everything, but still I can do something. And because I cannot do everything I will not refuse to do the something that I can do.â€<br />
<em>- </em><em><strong>Hellen Keller</strong></em></p>
<p align="center">
<p align="center">â€œHalf of the troubles of this life can be traced to saying yes too quickly and not saying no soon enough.â€<br />
- <em><strong>Josh Billings</strong></em></p>
<p align="center">
<p align="center">â€œEven if youâ€™re on the right track, youâ€™ll get run over if you just sit thereâ€<br />
- <em><strong>Will Rogers</strong></em></p>
<p align="center">
<p align="center">â€œAnyone who has never made a mistake has never tried anything new.â€- <em><strong>Albert Einstein</strong></em></p>
<p align="center">
<p>â€œThe important work of moving the world forward does not wait to be done by perfect men.â€ &#8211; <em><strong>George Eliot</strong></em><br />
â€œBe Content with what you have; rejoice in the way things are. When you realize there is nothing lacking, the whole world belongs to you.â€ -<em><strong>Lao Tzu</strong></em><br />
â€˜Be faithful to that which exists nowhere else except in yourself,thus making yourself indispensable.â€ -<em><strong>Andre Gilde</strong></em></p>
<p style="margin-bottom: 0in;">
</blockquote>
<p>I think you like my list. These thoughts used to spark your mind.</p>
<p>Thanks !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2009/02/some-inspirational-thoughts-from-some-genious-persons/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Preventing SQL Injection Attacks with MySQL and PHP</title>
		<link>http://www.phpgenious.com/2009/01/preventing-sql-injection-attacks-with-mysql-and-php/</link>
		<comments>http://www.phpgenious.com/2009/01/preventing-sql-injection-attacks-with-mysql-and-php/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:15:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.phpgenious.com/?p=63</guid>
		<description><![CDATA[Most new web developers have heard of SQL injection attacks, but not very many know that it is fairly easy to prevent an attacker from gaining access to your data [...]]]></description>
			<content:encoded><![CDATA[<p>Most new web developers have heard of SQL injection attacks, but not very many know that it is fairly easy to prevent an attacker from gaining access to your data by filtering out the vulnerabilities using MySQL extensions found in PHP. An SQL injection attack occurs when a hacker or cracker (a malicious hacker) attempts to dump the data in a database table in a database-driven web site. In an unprotected and vulnerable site, this is pretty easy to do.</p>
<p>In order for an SQL injection attack to work, the site must use an unprotected SQL query that utilizes data submitted by a user to lookup something in a database table. The data could be from a search box, a login form or any type of query used to look up data.</p>
<p>For Example:</p>
<p>Generally when you login, the query like this :</p>
<p><strong>SELECT * FROM <em>tbl_name </em>WHERE username=&#8217;<em>value1</em>&#8216; and password=&#8217;<em>value2</em>&#8216;</strong></p>
<p>Normally, you would expect a user to submit a username and password. But what if someone used the following instead of a password?</p>
<p><strong>&#8216;  OR  &#8217;1&#8242; =&#8217;1</strong></p>
<p>That would make the query used to look for the password look like this:</p>
<p><strong>SELECT * FROM <em>tbl_name </em>WHERE username=&#8217;<em>value1</em>&#8216; and password=&#8217;<em>value2&#8242;</em> OR &#8217;1&#8242; = &#8217;1&#8242;</strong></p>
<p>Your username and password is rightor wrong but this would always return a <strong>true.</strong></p>
<p><strong><span style="font-size: medium;">Prevention of SQL injection</span></strong></p>
<p>Use the following function to add backslashes to suspect characters and filter any data that is input by a user.</p>
<div class="code"><em>function cleanQuery($string)<br />
{<br />
if(get_magic_quotes_gpc())Â  // prevents duplicate backslashes<br />
{<br />
$string = stripslashes($string);<br />
}<br />
if (phpversion() &gt;= &#8217;4.3.0&#8242;)<br />
{<br />
$string = mysql_real_escape_string($string);<br />
}<br />
else<br />
{<br />
$string = mysql_escape_string($string);<br />
}<br />
return $string;<br />
}<br />
</em></div>
<p>You can filter a data like this : <span id="more-63"></span></p>
<p><strong>SELECT * FROM <em>tbl_name </em>WHERE username=CleanQuery(&#8216;<em>value1</em>&#8216;) and password=CleanQuery(&#8216;<em>value2&#8242;</em> OR &#8217;1&#8242; = &#8217;1&#8242;)</strong></p>
<p>The built-in function that we want to use is called <a href="http://www.php.net/mysql_real_escape_string" target="_blank"><span style="color: #0066cc;">mysql_real_escape_string</span></a>. This MySQL function only exists in PHP version 4.3.0 or newer. If you are using an older version of PHP, another MySQL function is used called <a href="http://www.php.net/mysql_escape_string" target="_blank"><span style="color: #0066cc;">mysql_escape_string</span></a>.</p>
<p>mysql_escape_string is not as effective as the newer mysql_real_escape_string. The newer version escapes the string according to the current character set. The character set is ignored by mysql_escape_string, which can leave some vulnerabilities ope for sophisticated hackers. If you find that you are using an older version of PHP and you are trying to protect sensitive data, you really should upgrade to a current version of either PHP 4 or PHP 5.</p>
<p><strong>So what does mysql_real_escape_string do?</strong></p>
<p>This PHP library function prepends backslashes to the following characters: \n, \r, \, \x00, \x1a, â€˜ and â€œ. The important part is that the single and double quotes are escaped, because these are the characters most likely to open up vulnerabilities.</p>
<p>For those who do not know what an escape is, it is a character that is pre-pended to another character. When a character is escaped, it is ignored by the database. In other words, it makes that character ineffective in a query. In the case of PHP, an escaped character is treated differently by the PHP parser. The standard escape character used by PHP and MySQL is the backslash.</p>
<p>In the case of the SQL query example used above, after running it through the routine, it now looks like this, which breaks the query :</p>
<pre><strong>SELECT * FROM <em>tbl_name </em>WHERE username=CleanQuery('<em>value1</em>') and password=CleanQuery </strong></pre>
<pre><strong>('<em>value2\'</em>Â  OR \'1\' = \'1')</strong>

<strong></strong>Â 

<span style="font-size: 10pt; font-family: Verdana;">This method should stop the bulk of the SQL injection attacks, but crackers and hackers are </span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;">very creative and are always finding new methods to break into systems. There are additional</span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;"> steps that can be taken to filter out certain words, such as drop, grant, union, etc.,</span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;"> but using this method will strip these words from searches performed by you users. </span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;">However, if you want to add another level of security and do not have an issue with </span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;">certain words being deleted from queries, you can add the following just before </span></pre>
<pre><span style="font-size: 10pt; font-family: Verdana;">if (phpversion() &gt;= â€˜4.3.0â€²).</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.phpgenious.com/2009/01/preventing-sql-injection-attacks-with-mysql-and-php/feed/</wfw:commentRss>
		<slash:comments>79</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! -->
