<?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>Tara Andrei &#187; web app</title>
	<atom:link href="http://www.andreitara.com/category/web-app/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andreitara.com</link>
	<description>a developer&#039;s blog</description>
	<lastBuildDate>Sun, 18 Jul 2010 17:46:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The magic of mode_rewrite</title>
		<link>http://www.andreitara.com/2010/06/the-magic-of-mode_rewrite/</link>
		<comments>http://www.andreitara.com/2010/06/the-magic-of-mode_rewrite/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:00:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programare]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[others]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[apache mode_rewrite]]></category>
		<category><![CDATA[installing mode_rewrite on linux]]></category>
		<category><![CDATA[installing mode_rewrite on windows]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=244</guid>
		<description><![CDATA[There&#8217;s a long time in the galaxy since I haven&#8217;t post on my blog and now,  finally here I am, posing a new article. Today I will speak about htaccess mod_rewrite. Well despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo.
The majority of the web servers, that are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2010/06/images.jpg"><img class="alignleft size-full wp-image-252" title="images" src="http://www.andreitara.com/wp-content/uploads/2010/06/images.jpg" alt="images" width="179" height="134" /></a>There&#8217;s a long time in the galaxy since I haven&#8217;t post on my blog and now,  finally here I am, posing a new article. Today I will speak about <a title=".Htaccess rewrites, Mod_Rewrite Tricks and Tips" href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">htaccess mod_rewrite</a>. Well despite the tons of examples and docs, <strong>mod_rewrite</strong> is voodoo. Damned cool voodoo, but still voodoo.</p>
<p>The majority of the web servers, that are based on Apache, have the mod_rewrite enabled so you don&#8217;t have to get dirty to install it on the hosting server.But anyone of those that are developing web application based on Apache server,  using PHP have a local installed server therefore mode_rewrite is also  necessary in testing process.<br />
<span id="more-244"></span></p>
<p>Installing mod_rewrite :</p>
<ol>
<li>On Linux: edit the Apache configuration file (  httpd.conf ) and uncomment   <em>LoadModule rewrite_module modules/mod_rewrite.so</em> (remove the  pound &#8216;#&#8217; sign from in front of the line) . Also be sure that the lines containing <em>ClearModuleList</em> and <em>AddModule mod_rewrite.c are</em> uncommented . Now you can create the famous .htacess file on the root of you website and start adding your code.</li>
<li>On Windows: well as we are expecting, things are a bit more complicated because on Windows you cannot create a file that doesn&#8217;t have a name (.htacess is a file that only have an extension). For first just uncomment the same lines as in the Linux example. Now you have to tell Apache to use you&#8217;re custom file instead of  .htacess file, so search in the configuration file (httpd.conf)  for the following lines:</li>
</ol>
<p style="padding-left: 60px;"><strong># AccessFileName: The  name of the file to look for in each directory # for additional  configuration directives. See also the AllowOverride<br />
# directive.<br />
#<br />
AccessFileName .htaccess (change the .htaccess to [name].htaccess where name can be whatever what you wish )</strong></p>
<p style="padding-left: 30px;">You can escape this step and create the .htacess file even on windows, actually the restriction of creating a file without name is an restriction of Windows Explorer is not an restriction of the operating system<strong> </strong>. Open the command (cmd), go to the root folder of the website and type <strong>copy con .htacess </strong>and press <strong>Ctrl+Z</strong>. well&#8230; that&#8217;s all folks.</p>
<p>Maybe you are asking yourself  about mod_rewrite and where to use it, well the short and  simple answer is :  for simplifying the URL of a website, simpler/shorter URL are easier to write easier to remember. For example instead of having an URL  like this www.example.com?id_product=23123&amp;color=23 you can have something like www.example.com/iphone-white. Mod_rewrite basicly make   use of regular expression to rewrite an specified URL.</p>
<p style="padding-left: 30px;">When to use it: mod_rewrite can be used in many circumstances where you may want to rewrite the an URL, also you can create dynamically virtual hosting entry;  practically mode_rewrite is an &#8220;Swiss Army Knife&#8221;.</p>
<p style="padding-left: 30px;">When not to use it: well as I have mentioned  before mode_rewrite make use of regular expression, and evaluating regular expression takes time, use memory and the global performance of the server is decreasing.</p>
<p>I will provide you some basic example of using mode_rewrite. .htaccess file should begin with:</p>
<pre style="padding-left: 60px;"><strong>Options +FollowSymLinks
RewriteEngine On
RewriteBase /

</strong></pre>
<ol>
<li><span style="text-decoration: underline;">Redirecting</span> <strong> </strong><br />
<strong>Redirect /index.php   http://www.example.com</strong>/    -this example redirect the current site to www.example.com<br />
RedirectMatch (.*)\.gif http://images.example.com$1.png      -In this example, we’ve taken all of our GIF files, converted them to PNG files, and<br />
moved them to another server</li>
<li><span style="text-decoration: underline;">Require www</span>
<pre>Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]</pre>
</li>
<li>Denying access to a folder except of fopen file from php
<pre>RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/.*\ HTTP [NC]
RewriteRule .* - [F,L]</pre>
</li>
<li>Limit access during some hours
<pre class="odd">Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# If the hour is 7
RewriteCond %{TIME_HOUR} ^7$
RewriteRule ^.*$ - [F,L]</pre>
</li>
</ol>
<p>These samples are here just to open your appetite for mode_rewrite. Practically this tool can be used in any other ways,yes&#8230; the limit is your imagination.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2010/06/the-magic-of-mode_rewrite/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protecting HTML source code from being stolen</title>
		<link>http://www.andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/</link>
		<comments>http://www.andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 19:01:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programare]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[web page protection]]></category>
		<category><![CDATA[hite web page code]]></category>
		<category><![CDATA[html protector]]></category>
		<category><![CDATA[javascript page encryptor]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=222</guid>
		<description><![CDATA[A  lot of people are asking me how they can protect the source code of HTML of they&#8217;re  site from being seen or worst being stolen. Well, the simple and short answer is that you can&#8217;t everything that the browser loads to render it can be seen by the user. The simplest method to protect [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-238" title="011810_home_security" src="http://www.andreitara.com/wp-content/uploads/2010/03/011810_home_security.jpg" alt="011810_home_security" width="243" height="243" />A  lot of people are asking me how they can <strong>protect the source code</strong> of HTML of they&#8217;re  site from being seen or worst being stolen. Well, the simple and <span style="text-decoration: underline;">short answer</span> is that <span style="text-decoration: underline;">you can&#8217;t</span> everything that the browser loads to render it can be seen by the user. The simplest method to protect you&#8217;re source HTML code is  never to publish it on Internet <img src='http://www.andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Well seriously, there are some <strong>meta methods</strong> to <strong>protect</strong> you&#8217;re <strong>HTML</strong> source from being seen by a common user not from an expert user.I will enumerate some methods starting with the simplest.<br />
<span id="more-222"></span></p>
<ul>
<li>The first method, maybe the most stupid one but used by many people (stupid ideas work for stupid people <img src='http://www.andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) is <strong>putting a lot of empty line in front of HTML source</strong>. If the user looks at the source will see just empty white page. But if he scroll down on bottom of the page he will see the source.</li>
<li>The  second method is to disable right click on page. To do that just take a look at next code://Disable right click script III- By Renigade (renigade@mediaone.net)<br />
//For full source code, visit http://www.dynamicdrive.com</p>
<p>var message=&#8221;";<br />
///////////////////////////////////<br />
function clickIE() {if (document.all) {(message);return false;}}<br />
function clickNS(e)<br />
{<br />
if(document.layers||(document.getElementById&amp;&amp;!document.all))<br />
{<br />
if (e.which==2||e.which==3)<br />
{(message);return false;}<br />
}<br />
}</p>
<p>if (document.layers)<br />
{<br />
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;<br />
}<br />
else<br />
{<br />
document.onmouseup=clickNS;document.oncontextmenu=clickIE;<br />
}</p>
<p>document.oncontextmenu=new Function(&#8221;return false&#8221;)<br />
// &#8211;&gt;</p>
<p>Now that the user can do right click-&gt;show page source,  you have achieved a good protection method,  if you user is a old granny  <img src='http://www.andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  that doesn&#8217;t know to use  (Ctrl+U)  shortcut or Edit-&gt;View page soure.</li>
<li>The third method is to <strong>use javascript</strong> to hide the HTML content. A short example is presented next:<br />
Let&#8217;s suppose that the page has the following code:&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&gt;<br />
&lt;title&gt;Sample HTML-hide sorece code&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
Blah blah blah<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Now what we have to do next is to &#8220;encrypt&#8221; this content, go to http://www.swingnote.com/tools/texttohex.php or a similar page and convert the text source code to an hexa representation. You will obtain something similar to this:<br />
%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e</p>
<p>The page is the same but now has a different representation that is strange to a common user but remember that this is a <em>meta protection method </em>an advanced user can and will do the reverse method to obtain you&#8217;re source.<br />
The next step is to create the &#8220;protected&#8221; page, create a new HTML document and add the next code:</p>
<p>&lt;script&gt;<br />
<strong>document.write</strong>(<strong>unescape</strong>(&#8221;%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e&#8221;));<br />
&lt;/script&gt;<br />
As you can see all we are doing is to use javascript to write the content (<strong>document.write</strong> method).<br />
<span style="color: #ff0000;">!!! Important</span> : if user has the javascript disabled he will not see anything because the code will not execute, therefore will  be nothing displayed. Also remember that most of searchengine as Google or Yahoo crawl  the web in text mode,  remember that <span style="text-decoration: underline;">javascript is luxury</span> not a necessity.</li>
<li>Now is time to get serious and speak about some more advanced, a little bit harder to break (not impossible to break), technique   to keep you HTML source protected.The base idea is to encrypt the content of the HTML page, this time really encryption . Let imagine  a function for encryption this time a simple one that is using xor logic function to achieve encryption. The code to do that is showed next:<br />
//Encryptionfunction encrypt(text,key){</p>
<p>var rez=new Array(text.length);<br />
for(i=0;i&lt;text.length;i++){<br />
rez[i]=text.charCodeAt(i) ^key.charCodeAt(i%key.length);<br />
}<br />
return rez;<br />
}</p>
<p>//Decryption</p>
<p>function decrypt(text,key){<br />
var rez=&#8221;";<br />
for(i=0;i&lt;text.length;i++){<br />
rez+=String.fromCharCode(text[i] ^key.charCodeAt(i%key.length));</p>
<p>}<br />
return rez;<br />
}</p>
<p>Using the functions in this form won&#8217;t help to much because the user will see clear what is about, so I am going to obfuscate the code (if you don&#8217;t know what is that google it <img src='http://www.andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Now the code looks not so friendly :</p>
<p>eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!&#8221;.replace(/^/,String)){while(c&#8211;){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return&#8217;\\w+&#8217;};c=1};while(c&#8211;){if(k[c]){p=p.replace(new RegExp(&#8217;\\b&#8217;+e(c)+&#8217;\\b&#8217;,'g&#8217;),k[c])}}return p}(&#8217;8 c(2,4){9 3=d b(2.5);7(1=0;1&lt;2.5;1++){3[1]=2.6(1)^4.6(1%4.5)}a 3}8 f(2,4){9 3=&#8221;";7(1=0;1&lt;2.5;1++){3+=e.g(2[1]^4.6(1%4.5))}a 3}&#8217;,17,17,&#8217;|i|text|rez|key|length|charCodeAt|for|function|var|return|Array|encrypt|new|String|decrypt|fromCharCode&#8217;.split(&#8217;|'),0,{}))</p>
<p>The next step is to convert you&#8217;re page in hexa as showed previously in this post, suppost that we are using the same page the hexa will be:</p>
<p>%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e</p>
<p>now is time to encrypt the hexa representation with a key, so apply encrypt(&#8221;&#8230;hexa text &#8230;.&#8221;,&#8221;&#8230;you personal key&#8230;&#8221;) . I used as key &#8220;secret&#8221; and have obtained this:</p>
<p>86,86,0,87,87,69,86,81,87,87,81,18,86,81,80,87,80,64,86,80,90,87,80,68,86,81,86,87,87,68,86,83,91,87,82,64,86,83,7,87,83,23,86,87,83,87,80,68,86,80,86,87,81,70,<br />
86,81,0,87,81,77,86,81,80,87,87,68,86,80,0,87,87,70,86,87,7,87,87,18,86,87,5,87,80,67,86,86,80,87,81,71,86,87,5,87,87,18,86,81,87,87,80,64,86,81,87,87,87,68,86,<br />
80,91,87,81,76,86,80,87,87,81,16,86,81,0,87,87,68,86,86,82,87,87,17,86,86,83,87,87,68,86,80,87,87,82,70,86,83,82,87,83,17,86,82,80,87,83,77,86,82,87,87,83,77,86,<br />
83,5,87,83,17,86,83,82,87,83,23,86,87,5,87,87,18,86,81,86,87,81,17,86,80,0,87,87,70,86,87,83,87,80,23,86,87,81,87,83,76,86,82,87,87,82,64,86,82,83,87,86,21,86,87,5<br />
,87,87,18,86,82,84,87,82,67,86,82,84,87,87,17,86,82,84,87,86,71,86,87,6,87,83,18,86,82,81,87,83,67,86,87,5,87,80,64,86,80,81,87,87,18,86,82,91,87,83,76,86,82,87,87,<br />
83,16,86,83,0,87,86,69,86,87,5,87,81,64,86,80,87,87,81,64,86,87,5,87,82,76,86,83,91,87,82,64,86,83,7,87,83,23,86,86,82,87,87,16,86,82,87,87,82,70,86,83,82,87,83,17,<br />
86,82,80,87,83,77,86,82,87,87,83,77,86,83,5,87,83,17,86,83,82,87,83,23,86,87,6,87,83,64,86,82,87,87,83,64,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,82,<br />
87,87,83,16,86,83,0,87,87,68,86,82,91,87,83,16,86,83,0,87,83,17,86,82,80,87,86,16,86,80,0,87,87,70,86,83,91,87,82,64,86,82,87,87,82,68,86,86,2,87,87,18,86,87,5,87,<br />
82,67,86,82,84,87,82,67,86,87,6,87,82,67,86,86,80,87,87,17,86,83,5,87,82,70,86,83,84,87,87,18,86,86,82,87,86,77,86,86,90,87,86,77,86,87,5,87,82,76,86,83,91,87,82,64<br />
,86,83,7,87,83,23,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,86,23,86,83,7,87,83,65,86,82,87,87,83,69,86,87,83,<br />
87,83,76,86,82,87,87,82,64,86,82,83,87,87,16,86,83,86,87,82,69,86,82,86,87,83,77,86,82,85,87,86,16,86,80,0,87,87,70,86,81,80,87,83,18,86,83,6,87,82,64,86,83,86,87,83,<br />
17,86,82,87,87,87,16,86,80,87,87,82,77,86,82,83,87,83,65,86,80,0,87,87,70,86,87,83,87,83,71,86,83,5,87,83,17,86,82,87,87,83,65,86,83,6,87,82,64,86,86,7,87,80,23,86,87<br />
,81,87,82,64,86,83,86,87,82,76,86,82,87,87,87,18,86,83,91,87,82,64,86,83,7,87,83,23,86,86,1,87,87,68,86,83,80,87,83,76,86,83,82,87,82,70,86,82,80,87,83,65,86,82,87,87,86,<br />
16,86,82,86,87,82,64,86,83,85,87,87,16,86,86,91,87,80,23,86,87,81,87,87,68,86,87,5,87,86,17,86,87,83,87,86,23,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,<br />
80,80,87,83,69,86,83,7,87,82,68,86,83,0,87,83,65,86,87,83,87,81,76,86,80,87,87,81,16,86,81,0,87,87,16,86,83,91,87,83,77,86,83,87,87,83,65,86,87,83,87,82,71,86,83,5,<br />
87,82,70,86,83,86,87,83,71,86,83,86,87,87,68,86,83,80,87,83,18,86,83,87,87,83,65,86,86,0,87,87,18,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,87,83,87,<br />
86,23,86,87,5,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,87,68,86,86,0,87,83,70,86,83,5,87,83,64,86,82,90,87,86,17,86,87,83,87,85,77,86,81,81,87,83,23,<br />
86,83,82,87,83,76,86,87,83,87,83,70,86,83,0,87,83,69,86,83,91,87,87,68,86,83,81,87,83,23,86,83,82,87,83,76,86,87,83,87,86,23,86,87,5,87,83,70,86,83,5,87,83,64,86,82,<br />
90,87,86,17,86,87,83,87,86,23,86,87,5,87,83,76,86,82,87,87,83,16,86,83,0,87,86,17</p>
<p>Now let&#8217;s create the script,that will display the content of page, that will be the final step:</p>
<p>document.write(unescape(decrypt(new Array(86,86,0,87,87,69,86,81,87,87,81,18,86,81,80,87,80,64,86,80,90,87,80,68,86,81,86,87,87,68,86,83,91,87,82,64,86,83,7,87,83,23,86,87,83,87,80,68,86,80,86,87,81,70,<br />
86,81,0,87,81,77,86,81,80,87,87,68,86,80,0,87,87,70,86,87,7,87,87,18,86,87,5,87,80,67,86,86,80,87,81,71,86,87,5,87,87,18,86,81,87,87,80,64,86,81,87,87,87,68,86,<br />
80,91,87,81,76,86,80,87,87,81,16,86,81,0,87,87,68,86,86,82,87,87,17,86,86,83,87,87,68,86,80,87,87,82,70,86,83,82,87,83,17,86,82,80,87,83,77,86,82,87,87,83,77,86,<br />
83,5,87,83,17,86,83,82,87,83,23,86,87,5,87,87,18,86,81,86,87,81,17,86,80,0,87,87,70,86,87,83,87,80,23,86,87,81,87,83,76,86,82,87,87,82,64,86,82,83,87,86,21,86,87,5<br />
,87,87,18,86,82,84,87,82,67,86,82,84,87,87,17,86,82,84,87,86,71,86,87,6,87,83,18,86,82,81,87,83,67,86,87,5,87,80,64,86,80,81,87,87,18,86,82,91,87,83,76,86,82,87,87,<br />
83,16,86,83,0,87,86,69,86,87,5,87,81,64,86,80,87,87,81,64,86,87,5,87,82,76,86,83,91,87,82,64,86,83,7,87,83,23,86,86,82,87,87,16,86,82,87,87,82,70,86,83,82,87,83,17,<br />
86,82,80,87,83,77,86,82,87,87,83,77,86,83,5,87,83,17,86,83,82,87,83,23,86,87,6,87,83,64,86,82,87,87,83,64,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,82,<br />
87,87,83,16,86,83,0,87,87,68,86,82,91,87,83,16,86,83,0,87,83,17,86,82,80,87,86,16,86,80,0,87,87,70,86,83,91,87,82,64,86,82,87,87,82,68,86,86,2,87,87,18,86,87,5,87,<br />
82,67,86,82,84,87,82,67,86,87,6,87,82,67,86,86,80,87,87,17,86,83,5,87,82,70,86,83,84,87,87,18,86,86,82,87,86,77,86,86,90,87,86,77,86,87,5,87,82,76,86,83,91,87,82,64<br />
,86,83,7,87,83,23,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,86,23,86,83,7,87,83,65,86,82,87,87,83,69,86,87,83,<br />
87,83,76,86,82,87,87,82,64,86,82,83,87,87,16,86,83,86,87,82,69,86,82,86,87,83,77,86,82,85,87,86,16,86,80,0,87,87,70,86,81,80,87,83,18,86,83,6,87,82,64,86,83,86,87,83,<br />
17,86,82,87,87,87,16,86,80,87,87,82,77,86,82,83,87,83,65,86,80,0,87,87,70,86,87,83,87,83,71,86,83,5,87,83,17,86,82,87,87,83,65,86,83,6,87,82,64,86,86,7,87,80,23,86,87<br />
,81,87,82,64,86,83,86,87,82,76,86,82,87,87,87,18,86,83,91,87,82,64,86,83,7,87,83,23,86,86,1,87,87,68,86,83,80,87,83,76,86,83,82,87,82,70,86,82,80,87,83,65,86,82,87,87,86,<br />
16,86,82,86,87,82,64,86,83,85,87,87,16,86,86,91,87,80,23,86,87,81,87,87,68,86,87,5,87,86,17,86,87,83,87,86,23,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,<br />
80,80,87,83,69,86,83,7,87,82,68,86,83,0,87,83,65,86,87,83,87,81,76,86,80,87,87,81,16,86,81,0,87,87,16,86,83,91,87,83,77,86,83,87,87,83,65,86,87,83,87,82,71,86,83,5,<br />
87,82,70,86,83,86,87,83,71,86,83,86,87,87,68,86,83,80,87,83,18,86,83,87,87,83,65,86,86,0,87,87,18,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,87,83,87,<br />
86,23,86,87,5,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,87,68,86,86,0,87,83,70,86,83,5,87,83,64,86,82,90,87,86,17,86,87,83,87,85,77,86,81,81,87,83,23,<br />
86,83,82,87,83,76,86,87,83,87,83,70,86,83,0,87,83,69,86,83,91,87,87,68,86,83,81,87,83,23,86,83,82,87,83,76,86,87,83,87,86,23,86,87,5,87,83,70,86,83,5,87,83,64,86,82,<br />
90,87,86,17,86,87,83,87,86,23,86,87,5,87,83,76,86,82,87,87,83,16,86,83,0,87,86,17),&#8221;<strong>secre</strong>t&#8221;)));</p>
<p>As you can see the key is &#8220;secret&#8221; you must chose a better one dynamic generate on each session stored  in cookies. For extra security obfuscate this cod too:</p>
<p>eval(function(p,a,c,k,e,d){e=function(c){return(c&lt;a?&#8221;:e(parseInt(c/a)))+((c=c%a)&gt;35?String.fromCharCode(c+29):c.toString(36))};if(!&#8221;.replace(/^/,String)){while(c&#8211;){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return&#8217;\\w+&#8217;};c=1};while(c&#8211;){if(k[c]){p=p.replace(new RegExp(&#8217;\\b&#8217;+e(c)+&#8217;\\b&#8217;,'g&#8217;),k[c])}}return p}(&#8217;y.w(A(v(t z(4,4,0,3,3,m,4,b,3,3,b,j,4,b,a,3,a,c,4,a,r,3,a,f,4,b,4,3,3,f,4,8,l,3,9,c,4,8,7,3,8,e,4,3,8,3,a,f,4,a,4,3,b,g,4,b,0,3,b,k,4,b,a,3,3,f,4,a,0,3,3,g,4,3,7,3,3,j,4,3,<br />
5,3,a,o,4,4,a,3,b,q,4,3,5,3,3,j,4,b,3,3,a,c,4,b,3,3,3,f,4,a,l,3,b,h,4,a,3,3,b,i,4,b,0,3,3,f,4,4,9,3,3,d,4,4,8,3,3,f,4,a,3,3,9,g,4,8,9,3,8,d,4,9,a,3,8,k,4,9,3,3,8,k,<br />
4,8,5,3,8,d,4,8,9,3,8,e,4,3,5,3,3,j,4,b,4,3,b,d,4,a,0,3,3,g,4,3,8,3,a,e,4,3,b,3,8,h,4,9,3,3,9,c,4,9,8,3,4,u,4,3,5,3,3,j,4,9,p,3,9,o,4,9,p,3,3,d,4,9,p,3,4,q,4,3,6,3<br />
,8,j,4,9,b,3,8,o,4,3,5,3,a,c,4,a,b,3,3,j,4,9,l,3,8,h,4,9,3,3,8,i,4,8,0,3,4,m,4,3,5,3,b,c,4,a,3,3,b,c,4,3,5,3,9,h,4,8,l,3,9,c,4,8,7,3,8,e,4,4,9,3,3,i,4,9,3,3,9,g,4,8,9,<br />
3,8,d,4,9,a,3,8,k,4,9,3,3,8,k,4,8,5,3,8,d,4,8,9,3,8,e,4,3,6,3,8,c,4,9,3,3,8,c,4,a,0,3,3,g,4,4,6,3,3,f,4,4,0,3,8,h,4,9,3,3,8,i,4,8,0,3,3,f,4,9,l,3,8,i,4,8,0,3,8,d,4,9,<br />
a,3,4,i,4,a,0,3,3,g,4,8,l,3,9,c,4,9,3,3,9,f,4,4,2,3,3,j,4,3,5,3,9,o,4,9,p,3,9,o,4,3,6,3,9,o,4,4,a,3,3,d,4,8,5,3,9,g,4,8,p,3,3,j,4,4,9,3,4,k,4,4,r,3,4,k,4,3,5,3,9,h,4,8,<br />
l,3,9,c,4,8,7,3,8,e,4,a,0,3,3,g,4,4,6,3,3,f,4,4,0,3,8,h,4,8,4,3,8,m,4,8,3,3,4,d,4,3,8,3,4,e,4,8,7,3,8,n,4,9,3,3,8,m,4,3,8,3,8,h,4,9,3,3,9,c,4,9,8,3,3,i,4,8,4,3,9,m,4,<br />
9,4,3,8,k,4,9,s,3,4,i,4,a,0,3,3,g,4,b,a,3,8,j,4,8,6,3,9,c,4,8,4,3,8,d,4,9,3,3,3,i,4,a,3,3,9,k,4,9,8,3,8,n,4,a,0,3,3,g,4,3,8,3,8,q,4,8,5,3,8,d,4,9,3,3,8,n,4,8,6,3,9,c,4,4,<br />
7,3,a,e,4,3,b,3,9,c,4,8,4,3,9,h,4,9,3,3,3,j,4,8,l,3,9,c,4,8,7,3,8,e,4,4,1,3,3,f,4,8,a,3,8,h,4,8,9,3,9,g,4,9,a,3,8,n,4,9,3,3,4,i,4,9,4,3,9,c,4,8,s,3,3,i,4,4,l,3,a,e,4,3,<br />
b,3,3,f,4,3,5,3,4,d,4,3,8,3,4,e,4,9,3,3,8,k,4,9,3,3,8,e,4,8,4,3,4,d,4,a,a,3,8,m,4,8,7,3,9,f,4,8,0,3,8,n,4,3,8,3,b,h,4,a,3,3,b,i,4,b,0,3,3,i,4,8,l,3,8,k,4,8,3,3,8,n,4,<br />
3,8,3,9,q,4,8,5,3,9,g,4,8,4,3,8,q,4,8,4,3,3,f,4,8,a,3,8,j,4,8,3,3,8,n,4,4,0,3,3,j,4,9,3,3,8,k,4,9,3,3,8,e,4,8,4,3,4,d,4,3,8,3,4,e,4,3,5,3,8,h,4,8,4,3,8,m,4,8,3,3,4,<br />
d,4,3,8,3,3,f,4,4,0,3,8,g,4,8,5,3,8,c,4,9,r,3,4,d,4,3,8,3,s,k,4,b,b,3,8,e,4,8,9,3,8,h,4,3,8,3,8,g,4,8,0,3,8,m,4,8,l,3,3,f,4,8,b,3,8,e,4,8,9,3,8,h,4,3,8,3,4,e,4,3,5,3,<br />
8,g,4,8,5,3,8,c,4,9,r,3,4,d,4,3,8,3,4,e,4,3,5,3,8,h,4,9,3,3,8,i,4,8,0,3,4,d),&#8221;x&#8221;)));&#8217;,37,37,&#8217;|||87|86||||83|82|80|81|64|17|23|68|70|76|16|18|77|91|69|65|67|84|<br />
71|90|85|new|21|decrypt|write|secret|document|Array|unescape&#8217;.split(&#8217;|'),0,{}))</p>
<p>We have an pretty good protection, must remember a <strong>meta HTML protection</strong> because this can be broken by a good hacker.<a href="HIDE_HTML"><br />
</a></li>
</ul>
<p>I hope that this article was helpful I am waiting for you&#8217;re feedback.</p>
<p><strong>[UPDATE:]</strong> here are the source used in this  article<br />
<a href="http://www.andreitara.com/wp-content/uploads/2010/03/Secure_HTML_code.rar">Secure_HTML_code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Bad web programming technique.</title>
		<link>http://www.andreitara.com/2010/02/bad-web-programming-technique/</link>
		<comments>http://www.andreitara.com/2010/02/bad-web-programming-technique/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:01:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[spaghetti code]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=215</guid>
		<description><![CDATA[ASP.Net and JSP are two wonderful enviroment to create web application, application that are easy to modify and adapt to all requirements, but the major problems of ASP.Net and JSP is that they are not cheap and slow, in fact there are not many hosting provider that are offering hosting service for this technologies at [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-217" title="code-stickers" src="http://www.andreitara.com/wp-content/uploads/2010/02/code-stickers1.jpg" alt="code-stickers" width="207" height="155" />ASP.Net and JSP are two wonderful enviroment to create web application, application that are easy to modify and adapt to all requirements, but the major problems of ASP.Net and JSP is that they are not cheap and slow, in fact there are not many hosting provider that are offering hosting service for this technologies at a affordable price (for a common user ).</p>
<p>Therefore  other affordable technology like PHP are commonly wide used by most common users. In comparison with Java  or C#,  PHP language is pretty simple and doesn&#8217;t relay on so much formalism and doesn&#8217;t need a lot of knowledge about programming, allowing users to create application without knowing much think about programming technique.</p>
<p>The side effect is that the applications developed in this way are extremely hard to debug and even more harder to extend from a very wide variety of factors, some I will discuss later in this paper.</p>
<ol>
<li> The first think to speak about  is the <em><strong>&#8220;spaghetti code&#8221;</strong></em> where the entire application logic (code) is meshed up in same file, you know what I am talking about: a lot of  if/else/for/while and functions with no logic organization.  To extend such crap application wrote by some other programmers is quite hard and unproductive.</li>
<li> Since version 4 PHP offers OOP(object orientated programming) but it seams that most of users doesn&#8217;t know how to use it right, how to increase their productivity using OOP programming technique and software engineering technique .It seams that web programmers are still writing code like in the stone age.</li>
<li>Another problem, <strong>the biggest one</strong> is that users are creating applications dependent on design. The design of a web site is changing frequently that means restructuring the code again and again and again.</li>
</ol>
<p>The list is still open. I will continue to add more and more bad programming technique.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2010/02/bad-web-programming-technique/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Prototipuri in JAVASCRIPT</title>
		<link>http://www.andreitara.com/2009/01/prototipuri-in-javascript/</link>
		<comments>http://www.andreitara.com/2009/01/prototipuri-in-javascript/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 21:36:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programare]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=53</guid>
		<description><![CDATA[Desi javascript nu suporta clase totusi se poate poate programa obiectual si anume folosind prototipuri. Javascript este un limbaj in care gasesti atat cele mai mari idiotenii posibile care s-au putut inventa in vre-un limbaj de programare cat si unele cu adevarat geniale, printre acestea se numara faptul ca un obiect in Javascript este un [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2008/11/scripts-icon.png"><img class="alignnone size-medium wp-image-17" title="scripts-icon" src="http://www.andreitara.com/wp-content/uploads/2008/11/scripts-icon.png" alt="" width="128" height="128" /></a>Desi javascript nu suporta clase totusi se poate poate programa obiectual si anume folosind prototipuri. Javascript este un limbaj in care gasesti atat cele mai mari idiotenii posibile care s-au putut inventa in vre-un limbaj de programare cat si unele cu adevarat geniale, printre acestea se numara faptul ca un obiect in Javascript este un container generic la care ii poti adauga oricand o noua proprietate sau &#8220;metoda&#8221;. Mai jos este un exemplu de &#8220;clasa&#8221; (un echivelent al unei clase din limbaje care suporta asa ceva) ce incapsuleaza mecanismul cunoscut si sub denumirea de AJAX.</p>
<p>Pentru cei care nu stiu AJAX este un mecanism de comunicare asicrona cu server-ul, adica pentru a aduce informatie nu este necesara un refresh de pagina.</p>
<p><span id="more-53"></span></p>
<blockquote><p>function AjaxRequest(url)</p>
<p>{</p>
<p>this.url=url;</p>
<p>this.xmlHttp=&#8221;";</p>
<p>this.init=function()</p>
<p>{</p>
<p>try</p>
<p>{</p>
<p>// Firefox, Opera 8.0+, Safari</p>
<p>this.xmlHttp=new XMLHttpRequest();</p>
<p>}</p>
<p>catch (e)</p>
<p>{</p>
<p>// Internet Explorer</p>
<p>try</p>
<p>{</p>
<p>this.xmlHttp=new ActiveXObject(&#8221;Msxml2.XMLHTTP&#8221;);</p>
<p>}</p>
<p>catch (e)</p>
<p>{</p>
<p>try</p>
<p>{</p>
<p>this.xmlHttp=new ActiveXObject(&#8221;Microsoft.XMLHTTP&#8221;);</p>
<p>}</p>
<p>catch (e)</p>
<p>{</p>
<p>alert(&#8221;Your browser does not support AJAX!&#8221;);</p>
<p>return false;</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>this.request=function()</p>
<p>{</p>
<p>this.init();</p>
<p>try{</p>
<p>this.xmlHttp.open(this.requestType,this.url,true);</p>
<p>}</p>
<p>catch(e)</p>
<p>{</p>
<p>this.onLoadFaild(e);</p>
<p>}</p>
<p>this.xmlHttp.send(this.vars);</p>
<p>var parent=this;</p>
<p>this.xmlHttp.onreadystatechange=function()</p>
<p>{</p>
<p>var done = 4, ok = 200;</p>
<p>if (parent.xmlHttp.readyState == done &amp;&amp; parent.xmlHttp.status == ok)</p>
<p>{</p>
<p>if (parent.xmlHttp.responseText)</p>
<p>{</p>
<p>parent.onLoad(parent.xmlHttp.responseText);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>this.get=function(vars)</p>
<p>{</p>
<p>this.vars=vars;</p>
<p>this.requestType=&#8221;GET&#8221;;</p>
<p>this.request();</p>
<p>}</p>
<p>this.post=function(vars)</p>
<p>{</p>
<p>this.vars=vars;</p>
<p>this.requestType=&#8221;POST&#8221;;</p>
<p>this.request();</p>
<p>}</p>
<p>}</p></blockquote>
<p>Codul este destul de simplu ..aproape ca vorbeste de la sine. Avantajul programarii folosind obiecte este ca utilizare este foarte simpla plus ca putem avea conexiuni multiple pe servere separate</p>
<blockquote><p>script1=new AjaxRequest(&#8221;http://un.site.de.undeva&#8221;);</p>
<p>script1.onLoad=function(sucess){</p>
<p>if(sucess==true){</p>
<p>prelucreaza informatia primita</p>
<p>}</p>
<p>}</p>
<p>script1.get(&#8221;");</p>
<p>script2=new AjaxRequest(&#8221;http://un.site.de.altundeva&#8221;);</p>
<p>script2.onLoad=function(sucess){</p>
<p>if(sucess==true){</p>
<p>prelucreaza informatia primita</p>
<p>}</p>
<p>}</p>
<p>script2.get(&#8221;");</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2009/01/prototipuri-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSS -cross site scripting</title>
		<link>http://www.andreitara.com/2008/11/xss-cross-site-scripting/</link>
		<comments>http://www.andreitara.com/2008/11/xss-cross-site-scripting/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 19:10:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[XSS]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=28</guid>
		<description><![CDATA[
Pentru cei care nu stiu  cross site scripting-ul est o vulnerabilitatea de securitate ,specifica aplicatiilor web, ce permite injectare de cod distrugator in paginile web vizualizate de catre utilizator. Ea este o vulnerabilitate client side adica nu are efect propriu-zis asupra informatie de pe server ..ati putea spune ca nu este un pericol din [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.andreitara.com/wp-content/uploads/2008/11/xss.png"><img class="size-medium wp-image-29 aligncenter" title="xss" src="http://www.andreitara.com/wp-content/uploads/2008/11/xss-300x200.png" alt="" width="300" height="200" /></a></p>
<p>Pentru cei care nu stiu  cross site scripting-ul est o vulnerabilitatea de securitate ,specifica aplicatiilor web, ce permite injectare de cod <span style="font-size: x-small;">distrugator</span> in paginile web vizualizate de catre utilizator. Ea este o vulnerabilitate client side adica nu are efect propriu-zis asupra informatie de pe server ..ati putea spune ca nu este un pericol din moment ce este client side dar sa ne imaginam urmatoare situatie : ce ar insemna daca pe site-ul unei  banci , pe una dintre pagini exista un fromular in care toti clientii sunt rugati sa isi introduca datele personale, iar infromatia se va trimite undeva in internet,..ei bine in acest caz este grav.</p>
<p>Pentru a rezolva problema a inputurilor nesecurizate am realizat utmatoarea <span id="more-28"></span>clasa in php cu o implementare simplificata mult.</p>
<blockquote><p>&lt;?php</p>
<p>class Secure {<br />
/**internals<br />
*<br />
*/<br />
var $data;<br />
var $notSecured=array();</p>
<p>/**Constructor<br />
*<br />
*/<br />
public function Secure(&amp;$data,$autosecure=true)<br />
{</p>
<p>$this-&gt;data=&amp;$data;<br />
if($autosecure==true)<br />
$this-&gt;secureInputs();</p>
<p>}<br />
/**<br />
* verify if the array is empty<br />
*/<br />
public function isEmpty()<br />
{</p>
<p>if(count($this-&gt;data)&lt;=0)<br />
return true;</p>
<p>foreach($this-&gt;data as $key=&gt;$value)<br />
{if(empty($value))<br />
return true;<br />
}</p>
<p>return false;<br />
}<br />
/**<br />
* secure all filds<br />
*/<br />
public function secureInputs()<br />
{</p>
<p>foreach ($this-&gt;data as $k =&gt; $v)<br />
{<br />
if($this-&gt;isNotSecured($k)==false)<br />
$this-&gt;data[$k]=htmlspecialchars($v, ENT_QUOTES);<br />
}</p>
<p>}<br />
/**<br />
* add key that is not secured<br />
*/<br />
public function addNotSecuredInputs(array $key)<br />
{<br />
$this-&gt;notSecured=$key;</p>
<p>}<br />
/**<br />
* check if input is one that that dosen&#8217;t have to be secured<br />
*/<br />
private function isNotSecured($key)<br />
{</p>
<p>for($i=0;$i&lt;count($this-&gt;notSecured);$i++)<br />
if(!strcmp($this-&gt;notSecured[$i],$key))<br />
return true;</p>
<p>return false;</p>
<p>}</p>
<p>}<br />
?&gt;</p></blockquote>
<p>Iata cum ar arata utilizarea acesti clase</p>
<blockquote><p>$sec=new Secur($_POST);</p></blockquote>
<p>dupa cum se vede am salvat mult munca, clasa putand fi utilizata ori de cate ori avem nevoie sa securizam inputurile.Ce s-ar intimpla daca de exmplu dorim ca anumite inputuri sa contina  cod html ??? Ei bine si problema acesta este rezolvabila cu mare usurinta</p>
<blockquote><p>$sec=new Secure($_GET,false);</p>
<p>$sec-&gt;addNotSecuredInputs(&#8221;nume_variabila_ce_contine_cod_html&#8221;);</p>
<p>$sec-&gt;secureInputs();</p></blockquote>
<p>Am ales o versiune minimala de implementare ce securizeaza doar cod html..voi reveni cu o versiune completa mult mai complexa ce securizeaza si  injectie sql generand rapoarte de securitate ( de exmplu se ia ip-ul utilizatorului cu ganduri necurate printre multe altele) &#8230;Oricum clasele de php pe care le mai postez din cand in cand pe blog sun cioturi din un farmawork al meu pe care intr-un final sper sa il aduc la stadiul unui cms..dar asta este o alta poveste. <img src='http://www.andreitara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2008/11/xss-cross-site-scripting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP o abordare obiectuala a dialogului cu baza de date</title>
		<link>http://www.andreitara.com/2008/11/13/</link>
		<comments>http://www.andreitara.com/2008/11/13/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 15:39:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web app]]></category>
		<category><![CDATA[clase]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[php mysql]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=13</guid>
		<description><![CDATA[
Dupa cum bine se stie PHP-ul este un limbaj orientat pe cod iar suportul pentru clase a aparut abia mai tarziu.
Astazi m-am gindit sa va arat un mic tutorial, si ca sa fiu mai practic am sa realizez citeva clase ce implementeaza majoritatea operatiilor necersare in lucrul cu baza de date in principiu este vorba [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2008/11/icon.png"><img class="alignnone size-medium wp-image-19" title="icon" src="http://www.andreitara.com/wp-content/uploads/2008/11/icon.png" alt="" width="82" height="82" /></a></p>
<p><span class="postbody">Dupa cum bine se stie PHP-ul este un limbaj orientat pe cod iar suportul pentru clase a aparut abia mai tarziu.<br />
Astazi m-am gindit sa va arat un mic tutorial, si ca sa fiu mai practic am sa realizez citeva clase ce implementeaza majoritatea operatiilor necersare in lucrul cu baza de date in principiu este vorba de patru clase<br />
<span style="font-weight: bold;"> MysqlQuerry MysqlConnector MysqlController si MysqlResource</span>.<br />
Si ca sa profitam la maxim de flexibilitatea oferita de progrmarea obiectuala haideti ca si clasele noastre sa implementeze fiecate cite o interfata&#8230;poate considerati acest pas inutil dar sa ne inchipuim ca dorim sa realizam o aplicatie ce foloseste un server de Mysql dar in timp s-ar putea sa facem o migratie catre un alt server tot ce trebuie sa facem este sa realizam clase ce implementeaza interfetele si modificariile in aplicatia noastra vor fi minime minime atita vreme cit interfata este respectata.<br />
Mai jos este dat codul pentru fiecare dintre interfete<br />
</span><br />
<span class="postbody"> <span style="font-weight: bold;">DbQuerry</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">interface DbQuerry {</p>
<p>/**<br />
* @ReturnType void<br />
* @ParamType querry<br />
*/<br />
public function execQuery($querry);<br />
}</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">DbController</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">interface DbController {</p>
<p>/**<br />
* @ReturnType void<br />
* @ParamType name string<br />
* @ParamType colomns<br />
*/<br />
public function createTable($name, $colomns);</p>
<p>/**<br />
* @ReturnType void<br />
* @ParamType name string<br />
*/<br />
public function deleteTable($name);</p>
<p>/**<br />
* @ParamType name string<br />
* @ParamType clone string<br />
*/<br />
public function cloneTable($name, $clone);</p>
<p>/**<br />
* @ParamType name string<br />
* @ParamType connector Database.DbConnector<br />
*/<br />
public function createDatabase($name);</p>
<p>/**<br />
* @ParamType name string<br />
* @ParamType connector Database.DbConnector<br />
*/<br />
public function deleteDatabase($name);</p>
<p>/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getLink();<br />
}</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">DbConnector</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">interface DbConnector {</p>
<p>/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getLink();</p>
<p>/**<br />
* @ReturnType void<br />
*/<br />
public function disconnect();</p>
<p>/**<br />
* @ReturnType void<br />
*/<br />
public function reconnect();<br />
}</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">DbTable</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">interface DbTable {</p>
<p>/**<br />
* @ParamType colomns<br />
* @ParamType values<br />
*/<br />
public function insert($colomns, $values);</p>
<p>/**<br />
* @ParamType condition<br />
*/<br />
public function delete($condition,$operation=&#8217;AND&#8217;);</p>
<p>/**<br />
* @ParamType colomns<br />
* @ParamType values<br />
* @ParamType conditions<br />
*/<br />
public function update($colomns, $values, $conditions);</p>
<p>/**<br />
* @ParamType condition<br />
*/<br />
public function select($colomns,$condition=&#8221;");</p>
<p>/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getData();<br />
/**<br />
* @ReturnType integer<br />
*/<br />
public function getRowsNumber();<br />
}</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
Aplicatia va lucra doar cu interfatele (de fapt cu implementari ale interfetelor) si in acest mod se respecta bine cunoscutul principuiu al segregarii interfetelor de implementare.<br />
Acum haideti sa arunacam o privire asupra implemetarii interfetelor</span></p>
<p><span style="font-weight: bold;">MysqlQuerry</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">class MysqlQuerry implements DbQuerry {<br />
/**<br />
* @AttributeType Database.MysqlResource<br />
*/<br />
private $resource;<br />
/**<br />
*  @AttributeType boolean<br />
* */<br />
public static $debug=false;</p>
<p>/**<br />
* @ParamType resource Database.MysqlResource<br />
*/<br />
public function setResource(MysqlResource $resource) {<br />
$this-&gt;resource=$resource;<br />
}</p>
<p>/**<br />
* @ParamType resource Database.MysqlResource<br />
*/<br />
public function MysqlQuerry(MysqlResource $resource) {<br />
$this-&gt;setResource($resource);<br />
}</p>
<p>/**<br />
* @ParamType querry<br />
*/<br />
public function execQuery($querry) {<br />
if(MysqlQuerry::$debug==true)<br />
echo($querry);</p>
<p>$result=mysql_query($querry,$this-&gt;resource-&gt;getResource());<br />
if(!$result){<br />
$error=mysql_error();<br />
throw new MysqlSintaxException($error);<br />
}</p>
<p>$resource=new MysqlResource($result);</p>
<p>if(MysqlQuerry::$debug==true)<br />
echo(mysql_info($this-&gt;resource-&gt;getResource()));</p>
<p>return $resource;<br />
}<br />
}</td>
</tr>
</tbody>
</table>
<p><span style="font-weight: bold;">MysqlController</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">class MysqlController extends MysqlQuerry implements DbController {<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $databaseName;</p>
<p>/**<br />
*  @AttributeType DbResource<br />
*/<br />
private $resource;</p>
<p>/**<br />
* @ParamType dbName<br />
* @ParamType connector Database.MysqlConnector<br />
*/<br />
public function MysqlController($dbName, MysqlConnector $connector) {<br />
parent::MysqlQuerry($connector-&gt;getLink());<br />
$this-&gt;databaseName=$dbName;<br />
$this-&gt;resource=$connector-&gt;getLink();</p>
<p>}</p>
<p>/**<br />
* @ReturnType void<br />
* @ParamType name string<br />
* @ParamType colomns<br />
*/<br />
public function createTable($name, $colomns) {</p>
<p>if(is_array($colomns))<br />
$colomns=implode(&#8221;,&#8221;,$colomns);<br />
$this-&gt;execQuery(&#8221;CREATE TABLE $name ($colomns)&#8221;);<br />
}</p>
<p>/**<br />
* @ReturnType void<br />
* @ParamType name string<br />
*/<br />
public function deleteTable($name) {<br />
$this-&gt;execQuery(&#8221;DELETE TABLE $name&#8221;);<br />
}</p>
<p>/**<br />
* @ParamType name string<br />
* @ParamType clone string<br />
*/<br />
public function cloneTable($name, $clone) {<br />
$this-&gt;execQuery(&#8221;CREATE TABLE $clone LIKE $name&#8221;);<br />
$this-&gt;execQuery(&#8221;INSERT $clone SELECT * FROM $name&#8221;);<br />
}</p>
<p>/**<br />
* @ParamType name string<br />
*/<br />
public function createDatabase($name) {<br />
$this-&gt;execQuery(&#8221;CREATE DATABASE $name&#8221;);<br />
}</p>
<p>/**<br />
* @ParamType name string<br />
*/<br />
public function deleteDatabase($name) {<br />
$this-&gt;execQuery(&#8221;DELETE DATABASE $name&#8221;);<br />
}<br />
/**<br />
* @ParamType querry<br />
*/<br />
public function execQuery($querry) {<br />
mysql_select_db($this-&gt;databaseName,$this-&gt;resource-&gt;getResource());<br />
return parent::execQuery($querry);</p>
<p>}<br />
/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getLink(){<br />
return $this-&gt;resource;<br />
}<br />
};</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">MysqlConnector</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">lass MysqlConnector implements DbConnector {<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $password;<br />
/**<br />
* @AttributeType Database.DbResource<br />
*/<br />
private $link;<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $user;<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $host;</p>
<p>/**<br />
* @ReturnType boolean<br />
*/<br />
public function pingServer() {<br />
$result= mysql_ping($this-&gt;getLink());<br />
return $result;<br />
}</p>
<p>/**<br />
* @ParamType host<br />
* @ParamType user<br />
* @ParamType password<br />
*/<br />
public function MysqlConnector($host=null, $user=null, $password=null) {<br />
$this-&gt;host=$host;<br />
$this-&gt;user=$user;<br />
$this-&gt;password=$password;<br />
$this-&gt;reconnect();<br />
}</p>
<p>/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getLink() {<br />
return $this-&gt;link;<br />
}</p>
<p>/**<br />
* @ReturnType void<br />
*/<br />
public function disconnect() {<br />
mysql_close($this-&gt;getLink()-&gt;getResource());<br />
}</p>
<p>/**<br />
* @ReturnType void<br />
*/<br />
public function reconnect() {<br />
$result=mysql_connect($this-&gt;host,$this-&gt;user,$this-&gt;password);<br />
if($result==false){<br />
$error=mysql_error();<br />
throw new MysqlConnectionException($error);<br />
return;<br />
}</p>
<p>$this-&gt;link=new MysqlResource($result);<br />
}<br />
/**<br />
* @ReturnType void<br />
*/<br />
public function __destruct(){<br />
$this-&gt;disconnect();<br />
}<br />
};</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">MysqlResource</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">class MysqlResource implements DbResource {<br />
private $resource;</p>
<p>/**<br />
* @ParamType resource<br />
*/<br />
public function MysqlResource($resource) {<br />
$this-&gt;resource=$resource;<br />
}</p>
<p>public function getResource() {<br />
return $this-&gt;resource;<br />
}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
<span style="font-weight: bold;">MysqlTable</span><br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">class MysqlTable extends MysqlQuerry implements DbTable {<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $name;<br />
/**<br />
* @AttributeType string<br />
*/<br />
private $tableResource=null;<br />
/**<br />
* @AttributeType DbController<br />
*/<br />
private $controllerLink;<br />
/**<br />
* @ParamType name<br />
* @ParamType connector Database.MysqlConnector<br />
*/<br />
public function MysqlTable($name, MysqlController $controler) {<br />
parent::MysqlQuerry($controler-&gt;getLink());<br />
$this-&gt;name=$name;<br />
$this-&gt;controllerLink=$controler;<br />
}</p>
<p>/**<br />
* @ParamType colomns<br />
* @ParamType values<br />
*/<br />
public function insert($colomns, $values) {<br />
if(is_array($colomns))<br />
$colomns=implode(&#8221;,&#8221;,$colomns);<br />
if(is_array($values))<br />
$values=implode(&#8221;,&#8221;,$values);</p>
<p>$this-&gt;execQuery(&#8221;INSERT INTO $this-&gt;name ($colomns) VALUES (&#8217;$values&#8217;)&#8221;);<br />
}</p>
<p>/**<br />
* @ParamType condition<br />
*/<br />
public function delete($condition,$operation=&#8217;AND&#8217;) {<br />
if(is_array($condition))<br />
$condition=implode(&#8221; $operation &#8220;,$condition);<br />
$this-&gt;execQuery(&#8221;DELETE FROM $this-&gt;name WHERE $condition&#8221;);<br />
}</p>
<p>/**<br />
* @ParamType colomns<br />
* @ParamType values<br />
* @ParamType conditions<br />
*/<br />
public function update($colomns, $values, $conditions) {<br />
if(!is_array($colomns))<br />
$colomns=explode(&#8221;,&#8221;,$colomns);<br />
if(!is_array($values))<br />
$values=explode(&#8221;,&#8221;,$values);<br />
if(is_array($conditions))<br />
$conditions=implode(&#8221; AND &#8220;,$conditions);<br />
if(count($colomns)!=count($values))<br />
throw new SintaxErrorException(&#8221;values and colomn must have the same size.&#8221;);</p>
<p>$rez=array();</p>
<p>for($i=0;$i&lt;count($colomns)-1;$i++){<br />
$rez.=$colomns[$i]=&#8221;=&#8217;$values[$i]&#8216;,&#8221;;<br />
}<br />
$rez.=$colomns[$i]=&#8221;=&#8217;$values[$i]&#8216;&#8221;;</p>
<p>$this-&gt;execQuery(&#8221;UPDATE $this-&gt;name SET $rez WHERE $conditions&#8221;);</p>
<p>}</p>
<p>/**<br />
* @ParamType condition<br />
*/<br />
public function select($colomns,$condition=&#8221;") {<br />
if(is_array($colomns))<br />
$colomns=implode(&#8221;,&#8221;,$colomns);<br />
if(is_array($condition))<br />
$condition=implode(&#8221; AND &#8220;,$condition);<br />
if($condition!=&#8221;")<br />
$this-&gt;tableResource=$this-&gt;execQuery(&#8221;SELECT $colomns FROM $this-&gt;name WHERE $conditions&#8221;);<br />
else<br />
$this-&gt;tableResource=$this-&gt;execQuery(&#8221;SELECT $colomns FROM $this-&gt;name &#8220;);</p>
<p>}</p>
<p>/**<br />
* @ReturnType Database.DbResource<br />
*/<br />
public function getData() {<br />
if($this-&gt;tableResource==null)<br />
throw new MysqlTableException(&#8221;no data selected in table&#8221;);</p>
<p>$i=0;<br />
$result=array();</p>
<p>while($row=mysql_fetch_object($this-&gt;tableResource-&gt;getResource()))<br />
{<br />
$result[$i++]=$row;<br />
}</p>
<p>return new MysqlResource($result);<br />
}<br />
/**<br />
* @ReturnType integer<br />
*/<br />
public function getRowsNumber() {<br />
if($this-&gt;tableResource==null)<br />
throw new MysqlTableException(&#8221;no data selected in table&#8221;);</p>
<p>return mysql_num_rows($this-&gt;tableResource-&gt;getResource());<br />
}<br />
/**<br />
*  @ParamType querry<br />
*/<br />
public function execQuery($querry) {<br />
return $this-&gt;controllerLink-&gt;execQuery($querry);</p>
<p>}<br />
};</td>
</tr>
</tbody>
</table>
<p><span class="postbody"><br />
Pentru a trata diversele erori ce pot aparea in timpul lucrului cu baza de date se lucreaza cu exceptii.Iata un exemplu ce foloseste clasele de mai sus, sa presupunem ca avem un tabel cu doua cimpuri id si nume:<br />
</span></p>
<table border="0" cellspacing="1" cellpadding="3" width="90%" align="center">
<tbody>
<tr>
<td><span class="genmed"><strong>Cod:</strong></span></td>
</tr>
<tr>
<td class="code">&lt;?php<br />
&#8230;<br />
try<br />
{<br />
$connector=new MysqlConnector(&#8221;host&#8221;,&#8221;user&#8221;,&#8221;parola&#8221;);<br />
$controller=new MysqlController(&#8221;nume_baza_de_date&#8221;,$connector);<br />
$table=new MysqlTable(&#8221;nume_tabel&#8221;,$controller);<br />
$table-&gt;select(&#8221;*&#8221;,&#8221;id=&#8217;1&#8242;&#8221;);<br />
$data=$table-&gt;getData()-&gt;getResource();</p>
<p>for($i=0;$i&lt;count($data);$i++)<br />
{<br />
echo($data-&gt;id);<br />
}</p>
<p>}</p>
<p>catch $ex)<br />
{<br />
echo(&#8221;eroare de sintaxa:&#8221;.$ex-&gt;getMesage());<br />
}<br />
catch(MysqlTableException $ex)<br />
{<br />
echo(&#8221;eroare:&#8221;.$ex-&gt;getMessage());<br />
}<br />
catch(MysqlConnectionException $ex)<br />
{<br />
echo(&#8221;eroare :&#8221;.$ex-&gt;getMessage());<br />
}<br />
catch(MysqlException $ex)<br />
{<br />
echo(&#8221;eroare :&#8221;.$ex-&gt;getMessage());<br />
}<br />
..</p>
<p>?&gt;</td>
</tr>
</tbody>
</table>
<p>O observatie foarte importanta este ce in cazul catchurilo ordinea este importanta astfel de exmplu daca aveam primul chatch MysqlException de fiecare data cind aparea o exceptie se intra pe primul catch deoarece MysqlException este o calsa din care se deriveaza celelalte tipuri astfel o exceptie de tipul MysqlSintaxException este si de tipul MysqlException.<br />
Pentru a va face o face o imagine asupra ierarhiei de clase am atasat o imagine</p>
<p style="text-align: center;"><a href="http://www.andreitara.com/wp-content/uploads/2008/11/asd.jpg"><img class="size-medium wp-image-14 aligncenter" title="asd" src="http://www.andreitara.com/wp-content/uploads/2008/11/asd-300x175.jpg" alt="" width="249" height="145" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreitara.com/2008/11/13/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
