<?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>Nisi's work blog</title>
	<atom:link href="http://wiki.nisi.ro/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiki.nisi.ro</link>
	<description>Nisi's work blog - programing tips</description>
	<lastBuildDate>Fri, 30 Mar 2012 17:29:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Transparent PNG in IE6 simple, easy mode</title>
		<link>http://wiki.nisi.ro/2012/03/transparent-png-in-ie6-simple-easy-mode/</link>
		<comments>http://wiki.nisi.ro/2012/03/transparent-png-in-ie6-simple-easy-mode/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 16:28:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[css ie6]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[png tranparency in IE6]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=419</guid>
		<description><![CDATA[IE6 should not be supported anymore but, there are alot of users witch use it, becouse they dont know any better or dont know how to install another one. So the hard part will come to the web developer witch need to make the web page ok for everyone including the IE6 users. By default [...]]]></description>
			<content:encoded><![CDATA[<p>IE6 should not be supported anymore but, there are alot of users witch use it, becouse they dont know any better or dont know how to install another one.</p>
<p>So the hard part will come to the web developer witch need to make the web page ok for everyone including the IE6 users.</p>
<p>By default IE6 will not show tranparency on a png. But you can do like this:</p>
<p>&nbsp;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;!&#8211;[if lte IE 6]&gt;
</div>
</li>
<li class="li1">
<div class="de1">DIV#yourDiv{
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;background-image: none;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/yourImage.png, sizingMethod=&#8217;scale&#8217;);
</div>
</li>
<li class="li2">
<div class="de2">}
</div>
</li>
<li class="li1">
<div class="de1">&lt; ! [endif] &#8211;&gt;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2012/03/transparent-png-in-ie6-simple-easy-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to submit sitemap.xml to Ask search engine</title>
		<link>http://wiki.nisi.ro/2012/03/how-to-submit-sitemap-xml-to-ask-search-engine/</link>
		<comments>http://wiki.nisi.ro/2012/03/how-to-submit-sitemap-xml-to-ask-search-engine/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 11:43:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[ask.com]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[sitemap. submit sitemap]]></category>
		<category><![CDATA[sitemap.xml]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=417</guid>
		<description><![CDATA[Ask.com search engine have a page where you can submit your sitemap.xml for easy crawling . See the link : http://submissions.ask.com/ping?sitemap=http://wiki.nisi.ro/sitemap.xml Just copy and paste it in your browser and replace http://wiki.nisi.ro/sitemap.xml with your website sitemap link. This is it.]]></description>
			<content:encoded><![CDATA[<p>Ask.com search engine have a page where you can submit your sitemap.xml for easy crawling .</p>
<p>See the link : <a href="http://submissions.ask.com/ping?sitemap=http://wiki.nisi.ro/sitemap.xml" target="_blank">http://submissions.ask.com/ping?sitemap=http://wiki.nisi.ro/sitemap.xml</a></p>
<p>Just copy and paste it in your browser and replace <a href="http://wiki.nisi.ro/sitemap.xml" target="_blank">http://wiki.nisi.ro/sitemap.xml</a> with your website sitemap link.</p>
<p>This is it.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2012/03/how-to-submit-sitemap-xml-to-ask-search-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert decimal number to fraction number in PHP</title>
		<link>http://wiki.nisi.ro/2012/03/convert-decimal-number-to-fraction-number-in-php/</link>
		<comments>http://wiki.nisi.ro/2012/03/convert-decimal-number-to-fraction-number-in-php/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 14:31:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[decimal]]></category>
		<category><![CDATA[fraction]]></category>
		<category><![CDATA[Great Common Divisor]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=415</guid>
		<description><![CDATA[Today I had encountered a nice math problem . To convert a decimal number into it corresponding fraction. Thanks to this post I had fount an easy solution that you can check bellow. I had not used the gmp_gcd function from PHP (witch was used in the post code version) but made a Great Common [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had encountered a nice math problem . To convert a decimal number into it corresponding fraction.</p>
<p>Thanks to <a href="http://www.daniweb.com/web-development/php/threads/382522/1647598#post1647598" target="_blank">this</a> post I had fount an easy solution that you can check bellow. I had not used the gmp_gcd function from PHP (witch was used in the post code version) but made a Great Common Divisor function using recursivity.</p>
<p>&nbsp;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> convertDec2Fraction<span class="br0">&#40;</span><span class="re0">$number</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$reverse</span> = <a href="http://www.php.net/strpos"><span class="kw3">strpos</span></a><span class="br0">&#40;</span><a href="http://www.php.net/strrev"><span class="kw3">strrev</span></a><span class="br0">&#40;</span><span class="re0">$number</span><span class="br0">&#41;</span>,<span class="st0">&#8216;.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$number</span> = <span class="br0">&#40;</span><a href="http://www.php.net/strpos"><span class="kw3">strpos</span></a><span class="br0">&#40;</span><span class="re0">$number</span>,<span class="st0">&#8217;0&#8242;</span><span class="br0">&#41;</span> == <span class="st0">&#8217;0&#8242;</span><span class="br0">&#41;</span> ? <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&#8217;0&#8242;</span>,<span class="st0">&#8221;</span>,<span class="re0">$number</span><span class="br0">&#41;</span> : <span class="re0">$number</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$n1</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&#8216;.&#8217;</span>,<span class="st0">&#8221;</span>,<span class="re0">$number</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$n2</span> = <a href="http://www.php.net/pow"><span class="kw3">pow</span></a><span class="br0">&#40;</span><span class="st0">&#8217;10&#8242;</span>,<span class="re0">$reverse</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$b</span> = gcd<span class="br0">&#40;</span><span class="re0">$n1</span>,<span class="re0">$n2</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$n1</span> / <span class="re0">$b</span> . <span class="st0">&quot;/&quot;</span> . <span class="re0">$n2</span> / <span class="re0">$b</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span>convertDec2Fraction<span class="br0">&#40;</span><span class="st0">&#8217;3.2&#8242;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> gcd<span class="br0">&#40;</span><span class="re0">$a</span>, <span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$a</span> == <span class="nu0">0</span> || <span class="re0">$b</span> == <span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/abs"><span class="kw3">abs</span></a><span class="br0">&#40;</span> <a href="http://www.php.net/max"><span class="kw3">max</span></a><span class="br0">&#40;</span><a href="http://www.php.net/abs"><span class="kw3">abs</span></a><span class="br0">&#40;</span><span class="re0">$a</span><span class="br0">&#41;</span>, <a href="http://www.php.net/abs"><span class="kw3">abs</span></a><span class="br0">&#40;</span><span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="re0">$r</span> = <span class="re0">$a</span> % <span class="re0">$b</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#40;</span><span class="re0">$r</span> != <span class="nu0">0</span><span class="br0">&#41;</span> ?</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; gcd<span class="br0">&#40;</span><span class="re0">$b</span>, <span class="re0">$r</span><span class="br0">&#41;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/abs"><span class="kw3">abs</span></a><span class="br0">&#40;</span><span class="re0">$b</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2012/03/convert-decimal-number-to-fraction-number-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get base URL from Javascript, detect http or https</title>
		<link>http://wiki.nisi.ro/2012/03/get-base-url-from-javascript-detect-http-or-https/</link>
		<comments>http://wiki.nisi.ro/2012/03/get-base-url-from-javascript-detect-http-or-https/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 11:03:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[get server host]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL parts]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=412</guid>
		<description><![CDATA[When using ajax requests you have to request data from same domain as the domain as the one from where you requesti it. www.mydomain.com is not the same with mydomain.com so when you request it you should be careful not to request from wrong domain becouse no data is sent (&#8220;for security reasons&#8221;). Following you [...]]]></description>
			<content:encoded><![CDATA[<p>When using ajax requests you have to request data from same domain as the domain as the one from where you requesti it.</p>
<p>www.mydomain.com is not the same with mydomain.com so when you request it you should be careful not to request from wrong domain becouse no data is sent (&#8220;for security reasons&#8221;).</p>
<p>Following you can find a script to get the right address:</p>
<p>&nbsp;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> &nbsp; &nbsp;<span class="kw2">function</span> getServerHost<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> url = window.<span class="me1">location</span>.<span class="me1">href</span>; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; url = url.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;http://&quot;</span>, <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; url = url.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;https://&quot;</span>, <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> urlExplode = url.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;/&quot;</span><span class="br0">&#41;</span>; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> serverName = urlExplode<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; serverName = window.<span class="me1">location</span>.<span class="me1">protocol</span> + <span class="st0">&#8216;//&#8217;</span> + serverName; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> serverName; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>hope it help and &#8230;. please support us visiting some sponsors</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2012/03/get-base-url-from-javascript-detect-http-or-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable comments notification for WordPress</title>
		<link>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/</link>
		<comments>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=408</guid>
		<description><![CDATA[Do you receive alot of emails sent by your WordPress Blog becouse people comment your posts? You can turn this off like this: 1. Login to your blog admin page 2. Click on Settings -&#62; Discussion 3. Search in that list for &#8220;E-mail me whenever:&#8221; Now by default you receive email when &#8220;Anyone posts a [...]]]></description>
			<content:encoded><![CDATA[<p>Do you receive alot of emails sent by your WordPress Blog becouse people comment your posts?</p>
<p>You can turn this off like this:</p>
<p>1. Login to your blog admin page</p>
<p>2. Click on Settings -&gt; Discussion</p>
<p>3. Search in that list for &#8220;<em>E-mail me whenever</em>:&#8221;</p>
<p>Now by default you receive email when &#8220;<em>Anyone posts a comment</em>&#8221; and &#8220;<em>A comment is held for moderation</em>&#8220;. Uncheck any or both of this options as you like.</p>
<p>You should definitely uncheck &#8220;Anyone posts a comment&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to find the wrapper &#8220;https&#8221;</title>
		<link>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/</link>
		<comments>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 05:07:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[apache module]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[facebook login]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php_openssl]]></category>
		<category><![CDATA[ssl_module]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=402</guid>
		<description><![CDATA[Today I had to put a simple script on one of my hosting server where a &#8220;Facebook Login&#8221; button was available for login. However when I had to run it I encountered the following error: Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper &#8220;https&#8221; &#8211; did you forget to enable it when you configured PHP? [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to put a simple script on one of my hosting server where a &#8220;<strong><a href="http://developers.facebook.com/docs/guides/web/#login" target="_blank">Facebook Login</a></strong>&#8221; button was available for login. However when I had to run it I encountered the following error:</p>
<p><em><strong>Warning:</strong> file_get_contents() [function.file-get-contents]: Unable to find the wrapper &#8220;https&#8221; &#8211; did you forget to enable it when you configured PHP?</em></p>
<p>This was becouse the url served to <strong><em>file_get_contents</em></strong> start with http:// &#8230;.</p>
<p>If you have the same problem there are 2 steps to rezolve it:</p>
<ol>
<li>apache module ssl_module need to be avilble</li>
<li>php extension php_openssl need to be activated too</li>
</ol>
<p>Server restart and you are good to go.</p>
<p>To test from PHP is extension php_openssl is active just paste this code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/extension_loaded"><span class="kw3">extension_loaded</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl ok&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl off&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$_FILES limitation when uploading files in PHP</title>
		<link>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/</link>
		<comments>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:10:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[$_FILES]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascriupt]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upload file]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=395</guid>
		<description><![CDATA[Along with the &#8220;upload_max_filesize&#8221; when uploading files with PHP there is another parameter named &#8220;max_file_uploads&#8221; witch prevent uploading more files that the value of this parameter. Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a [...]]]></description>
			<content:encoded><![CDATA[<p>Along with the &#8220;upload_max_filesize&#8221; when uploading files with PHP there is another parameter named &#8220;max_file_uploads&#8221; witch prevent uploading more files that the value of this parameter.</p>
<p>Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a page where a form contain 30 file uploads and just 20 were availble in $_FILES from php script.</p>
<p><strong>How can you change this?</strong></p>
<p>There are 2 methods. One is to change it from php.ini but not always you can access php.ini file</p>
<p>The second method <strong>is not</strong> using ini_set :( . Tried that and not working.</p>
<p>I did find another method witch need some javascript. The method is when submiting the form a javascript will disable all unused upload elements like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">jQuery<span class="br0">&#40;</span><span class="st0">&quot;#upload_files1&quot;</span><span class="br0">&#41;</span>.<span class="me1">submit</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; jQuery<span class="br0">&#40;</span><span class="st0">&#8216;input:file[value=&quot;&quot;]&#8216;</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span>, <span class="kw2">true</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>and the form:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;form id=&quot;upload_files1&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li2">
<div class="de2">&#8230;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;save&quot; type=&quot;submit&quot; value=&quot;Save&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/form&gt;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7pic &#8211; the new free photo hosting service</title>
		<link>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/</link>
		<comments>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/#comments</comments>
		<pubDate>Mon, 30 May 2011 18:42:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Websites & Web services]]></category>
		<category><![CDATA[7pic.com]]></category>
		<category><![CDATA[free photo sharing]]></category>
		<category><![CDATA[image hosting]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=392</guid>
		<description><![CDATA[I had stumbled today on 7pic.com website witch is a new and free hosting service for photo sharing. I give it a try and I like it becouse i can use the 7pic uploader to upload picts without to start a browser. Uploaded images are stored in albums and can be shares as an images [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://7pic.com/l/1/?a=1078" target="_blank"><img class="alignleft" title="7pic free photo hosting service" src="http://fs14.7pic.com/66c76a.jpg" alt="" width="500" height="189" /></a>I had stumbled today on <a href="http://7pic.com/l/1/?a=1078" target="_blank">7pic.com</a> website witch is a new and free hosting service for photo sharing. I give it a try and I like it becouse i can use the 7pic uploader to upload picts without to start a browser.</p>
<p>Uploaded images are stored in albums and can be shares as an images witch can be embedded in a blog post or as a link to a page on <a href="http://7pic.com/l/1/?a=1078" target="_blank">7pic.com</a> where anybody can comment that images share on facebook, twitter and other social networks and of course anybody can rate the picture.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use call_user_func_array with a simple function and with class methods</title>
		<link>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/</link>
		<comments>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/#comments</comments>
		<pubDate>Sat, 28 May 2011 11:49:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[call_user_func_array]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[static]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=386</guid>
		<description><![CDATA[In this post you will see a example of using call_user_func_array (from PHP) to call a simple function, a public static method from a class and a public method. First I define one function and one class: function add&#40;$p1, $p2&#41;&#123; &#160; &#160;return $p1 + $p2; &#125; &#160; class CSimpleMath&#123; &#160; &#160;function __construct&#40;$v1&#41; &#123; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>In this post you will see a example of using call_user_func_array (from PHP) to call a simple function, a public static method from a class and a public method.</p>
<p>First I define one function and one class:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> add<span class="br0">&#40;</span><span class="re0">$p1</span>, <span class="re0">$p2</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">return</span> <span class="re0">$p1</span> + <span class="re0">$p2</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">class</span> CSimpleMath<span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="re0">$v1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">public</span> <a href="http://www.php.net/static"><span class="kw3">static</span></a> <span class="kw2">function</span> multiply<span class="br0">&#40;</span><span class="re0">$a</span>, <span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$a</span> * <span class="re0">$b</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">public</span> <span class="kw2">function</span> substract<span class="br0">&#40;</span><span class="re0">$a</span>, <span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$b</span> &#8211; <span class="re0">$a</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">function</span> __destruct<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span>&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Maybe you notice that in the class I did inserted a construct and destruct functions. You dont realy need them for this example to work but I always include them when I write a class.</p>
<p><strong>Call a simple function with call_user_func_array:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;add&#8217;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p><strong>Call a public static method:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;CSimpleMath::multiply&#8217;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p><strong>Call a public class method</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;CSimpleMath&#8217;</span>, <span class="st0">&#8216;substract&#8217;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Progress bar&#8221; for long running cron scripts in PHP</title>
		<link>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/</link>
		<comments>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/#comments</comments>
		<pubDate>Thu, 12 May 2011 13:43:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cron progress]]></category>
		<category><![CDATA[email progress bar]]></category>
		<category><![CDATA[long running]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=381</guid>
		<description><![CDATA[Long running scripts can be a pain if you dont know how much will be running. If you need to see a progress and flush() or ob_flush() do not work becouse of browser cache you can implement an &#8220;email progress bar&#8221;. PHP example: $step = 0; $last_percent = 0; $total_rows = while&#40;1&#41; &#123; &#160; &#160;$step++; [...]]]></description>
			<content:encoded><![CDATA[<p>Long running scripts can be a pain if you dont know how much will be running. If you need to see a progress and flush() or ob_flush() do not work becouse of browser cache you can implement an &#8220;email progress bar&#8221;.</p>
<p><strong>PHP example:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">$step</span> = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$last_percent</span> = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$total_rows</span> =</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">while</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="re0">$step</span>++; <span class="co1">//count step</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="co1">// here should be is the code witch consume time for every loop</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="co1">// end consuming time code</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="re0">$procent</span> = <span class="br0">&#40;</span><span class="re0">$step</span> * <span class="nu0">100</span><span class="br0">&#41;</span> / <span class="re0">$total_rows</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$last_percent</span> != <a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><span class="re0">$procent</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="co1">// becouse you do not want to receive an email for every step</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="re0">$last_percent</span> = <a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><span class="re0">$procent</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re0">$last_percent</span> % <span class="nu0">10</span><span class="br0">&#41;</span> == <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span> &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// this will send email from 10 % to 10 % &#8211; total 10 emails</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span>your_email_here, <span class="st0">&#8216;Progress &#8216;</span>.<span class="re0">$last_percent</span>.<span class="st0">&#8216;% done&#8217;</span> , <span class="st0">&quot;Progress: &quot;</span>.<span class="re0">$contor</span>.<span class="st0">&quot;/&quot;</span>.<span class="re0">$total_rows</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> <span class="co1">// end while</span></div>
</li>
</ol>
</div>
<p>As you can see the ideea is very simple and you can implement it in any language.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

