<?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>Break the Style &#187; PHP Tutorial</title>
	<atom:link href="http://www.shahporan.com/post-item/category/php-tutorial/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shahporan.com</link>
	<description>Lets develop web based world</description>
	<lastBuildDate>Mon, 04 Jul 2011 10:24:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to change Ubuntu Password</title>
		<link>http://www.shahporan.com/post-item/182.html</link>
		<comments>http://www.shahporan.com/post-item/182.html#comments</comments>
		<pubDate>Wed, 16 Feb 2011 07:14:08 +0000</pubDate>
		<dc:creator>Paran</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.shahporan.com/?p=182</guid>
		<description><![CDATA[Different purpose we need to change the password. It may OS or other device. Different device changing option different. So, I like to to discuss here how to change Ubuntu Password. This tips is important for novice Ubuntu user. Ok, Lets see how to do it. First Technique: Go to: System-&#62;Preferences-&#62;About Me Click to Change [...]]]></description>
			<content:encoded><![CDATA[<p>Different purpose we need to change the password. It may OS or other device. Different device changing option different. So, I like to to discuss here how to change Ubuntu Password. This tips is important for novice Ubuntu user. Ok, Lets see how to do it.</p>
<p>First Technique:</p>
<p>Go to: System-&gt;Preferences-&gt;About Me</p>
<p><a rel="attachment wp-att-183" href="http://www.shahporan.com/post-item/182.html/pass"><img class="aligncenter size-medium wp-image-183" title="pass" src="http://www.shahporan.com/wp-content/uploads/2011/02/pass-300x133.png" alt="" width="300" height="133" /></a>Click to Change Password Button</p>
<p>Then Enter the current password and click to the Authenticate</p>
<p><a rel="attachment wp-att-184" href="http://www.shahporan.com/post-item/182.html/change"><img class="aligncenter size-medium wp-image-184" title="change" src="http://www.shahporan.com/wp-content/uploads/2011/02/change-300x189.png" alt="" width="300" height="189" /></a>Then Enter the New Password, also Retype the new Password.</p>
<p>Then Click to the Change Password Button. Oh, Try to Enter the strong password.</p>
<p>Now your Current Password is establish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shahporan.com/post-item/182.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to print/retrieve current page link location</title>
		<link>http://www.shahporan.com/post-item/153.html</link>
		<comments>http://www.shahporan.com/post-item/153.html#comments</comments>
		<pubDate>Thu, 28 Oct 2010 03:53:37 +0000</pubDate>
		<dc:creator>Paran</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.shahporan.com/?p=153</guid>
		<description><![CDATA[Several time we need to print or retrieve current page link location. Or Several time we need to pass the instant page link location. But how to do it? Ok, just I try to give you some hints about this. Just you can add this code on your page head or you can add the [...]]]></description>
			<content:encoded><![CDATA[<p>Several time we need to print or retrieve current page link location. Or Several time we need to pass the instant page link location. But how to do it? Ok, just I try to give you some hints about this. Just you can add this code on your page head or you can add the following function on your site configuration page.</p>
<p>&lt;?php<br />
function curPageURL() {<br />
$pageURL = &#8216;http&#8217;;<br />
if ($_SERVER["HTTPS"] == &#8220;on&#8221;) {$pageURL .= &#8220;s&#8221;;}<br />
$pageURL .= &#8220;://&#8221;;<br />
if ($_SERVER["SERVER_PORT"] != &#8220;80&#8243;) {<br />
$pageURL .= $_SERVER["SERVER_NAME"].&#8221;:&#8221;.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];<br />
} else {<br />
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];<br />
}<br />
return $pageURL;<br />
}<br />
?&gt;</p>
<p>Now, you need to call this function on your desired place where you want to print this link location. Call system are as follows:</p>
<p>&lt;?php<br />
echo curPageURL();<br />
?&gt;</p>
<p>I hope it will be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shahporan.com/post-item/153.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Avoid the PHP_SELF exploits</title>
		<link>http://www.shahporan.com/post-item/143.html</link>
		<comments>http://www.shahporan.com/post-item/143.html#comments</comments>
		<pubDate>Fri, 01 Oct 2010 18:21:45 +0000</pubDate>
		<dc:creator>Paran</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.shahporan.com/?p=143</guid>
		<description><![CDATA[PHP_SELF exploits can be avoided by using the htmlentities() function. For example, the form code should be like this to avoid the PHP_SELF exploits: &#60;form name="test" action="&#60;?php echo htmlentities($_SERVER['PHP_SELF']); ?&#62;" method="post"&#62; The htmlentities() function encodes the HTML entities. Now if the user tries to exploit the PHP_SELF variable, the attempt will fail and the result [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>PHP_SELF exploits can be avoided by using the  		<a href="http://us2.php.net/manual/en/function.htmlentities.php">htmlentities()</a> function. 		For example, the form code should be like this to avoid the PHP_SELF exploits:</p>
<pre>&lt;form name="test" action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']); ?&gt;"
method="post"&gt;</pre>
<p>The htmlentities() function encodes the HTML entities.  		Now if the user tries to exploit the PHP_SELF variable, the attempt will 		fail and the result of entering malicious code in URL will result in the  		following output: <span id="more-143"></span></p>
<p>&lt;form name=&#8221;test&#8221; method=&#8221;post&#8221;  action=&#8221;form-action.php/&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&#8216;xss&#8217;)&amp; lt;/script&amp;gt;&amp;lt;foo&#8221;&gt;</p>
<p>As you can see, the script part is now &#8216;sanitized&#8217;.</p>
<p>So don&#8217;t forget to convert every occurrence of &#8220;$_SERVER['PHP_SELF']&#8221; into  		&#8220;htmlentities($_SERVER['PHP_SELF'])&#8221; throughout your script.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.shahporan.com/post-item/143.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What are PHP_SELF exploits and how to avoid them</title>
		<link>http://www.shahporan.com/post-item/138.html</link>
		<comments>http://www.shahporan.com/post-item/138.html#comments</comments>
		<pubDate>Fri, 01 Oct 2010 18:09:17 +0000</pubDate>
		<dc:creator>Paran</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.shahporan.com/?p=138</guid>
		<description><![CDATA[The PHP_SELF variable is used to get the name and path of the current file but it can be used by the hackers too. If PHP_SELF is used in your page then a user can enter a slash (/) and then some Cross Site Scripting (XSS) commands to execute. See below for an example: &#60;form [...]]]></description>
			<content:encoded><![CDATA[<p>The PHP_SELF variable is used to get the name and path of the current file but it can be used  		by the hackers too. If PHP_SELF is used in your  		page then a user can enter a slash (/) and then some Cross Site Scripting (XSS)  		commands to execute.</p>
<p>See below for an example:</p>
<pre>&lt;form name="test" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt;</pre>
<p>Now, if a user has entered the normal URL in the address bar  		like &#8220;http://www.yourdomain.com/form-action.php&#8221;, the above code will be translated as:</p>
<pre>&lt;form name="test" action="form-action.php" method="post"&gt;</pre>
<p>This is the normal case.<span id="more-138"></span></p>
<p>Now consider that the user has called this script by entering the following  		URL in the browser&#8217;s address bar:</p>
<pre>http://www.yourdomain.com/form-action.php/%22%3E%3Cscript%3Ealert('xss')%3C
/script%3E%3Cfoo%22</pre>
<p>In this case, after PHP processing the code becomes:</p>
<pre>&lt;form name="test" method="post" action="form-action.php"/&gt;
&lt;script&gt;alert('xss')&lt;/script&gt;&lt;foo""&gt;</pre>
<p>You can see that this code has added a script tag and an alert command.  			When this page is be loaded, user will see an alert box. 			This is just a simple example how the PHP_SELF variable can be exploited.</p>
<p>Any JavaScript  code can be added between the &#8220;script&#8221; tag.  		&lt;script&gt;&#8230;.HERE&#8230;.&lt;/script&gt;.  		A hacker can link to a JavaScript  file that may be located on another server.  		That JavaScript  file can hold the malicious code that can alter the 		global variables and can also submit the form to another address to  		capture the user data, for example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shahporan.com/post-item/138.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
