<?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>Abdelkader ELKALDI - Web Application Developer &#187; Tricks</title>
	<atom:link href="http://updel.com/category/development/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://updel.com</link>
	<description>Just another Web Application Developer</description>
	<lastBuildDate>Mon, 23 May 2011 17:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automaticly Copy Zend/Symfony Library to Project</title>
		<link>http://updel.com/automaticly-copy-zendsymfony-library-to-project/</link>
		<comments>http://updel.com/automaticly-copy-zendsymfony-library-to-project/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:39:47 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://updel.com/?p=501</guid>
		<description><![CDATA[Zend Framework Batch file @echo off :MENU ECHO Zend will be copied to &#34;%CD%\library&#34; SET /P M=Type PRESS 1 to continue or any key to EXIT: IF %M%==1 ( GOTO IMPORT ) ELSE ( GOTO :EOF ) :IMPORT xcopy /E &#34;ABSOLUTE_PATH_TO_Zend_Library&#34; &#34;%CD%\library&#34; GOTO :EOF Symfony Framework Batch file @echo off :MENU ECHO Symfony will be [...]]]></description>
			<content:encoded><![CDATA[<h3>Zend Framework Batch file</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Zend will be copied to &quot;%CD%\library&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;ABSOLUTE_PATH_TO_Zend_Library&quot; &quot;%CD%\library&quot;
GOTO :EOF
</pre>
<h3>Symfony Framework Batch file</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Symfony will be copied to &quot;%CD%\lib\vendor&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;ABSOLUTE_PATH_TO_Symfony_Library&quot; &quot;%CD%\lib\vendor\&quot;
GOTO :EOF
</pre>
<p><span id="more-501"></span></p>
<h3>Example :</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Zend will be copied to &quot;%CD%\library&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;D:\xampp\ZendFramework\library&quot; &quot;%CD%\library&quot;
GOTO :EOF
</pre>
<h3>How Does It Work ?</h3>
<p><strong>1 . Save batch as what_you_want.bat, example </strong><strong><span style="color: #ff0000;">zendme.bat</span> then add to windows Path .</strong><br />
<a href="http://updel.com/wp-content/uploads/automatic_zendme.jpg"><img class="aligncenter size-full wp-image-527" title="automatic_zendme" src="http://updel.com/wp-content/uploads/automatic_zendme.jpg" alt="" width="592" height="370" /></a></p>
<p><strong>2 . Go to your project &#8220;CD My_project&#8221; and type &#8220;Batch_file_name&#8221;</strong><br />
<a href="http://updel.com/wp-content/uploads/zendme.jpg"><img class="aligncenter size-full wp-image-528" title="zendme" src="http://updel.com/wp-content/uploads/zendme.jpg" alt="" width="374" height="99" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/automaticly-copy-zendsymfony-library-to-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plesk : How to pointing domain to a subdirectory</title>
		<link>http://updel.com/plesk-pointing-domain-subdirectory/</link>
		<comments>http://updel.com/plesk-pointing-domain-subdirectory/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:24:30 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[dns domain plesk]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Pointing domain plesk]]></category>
		<category><![CDATA[Pointing domain subdirectory]]></category>
		<category><![CDATA[subdomain plesk]]></category>

		<guid isPermaLink="false">http://updel.com/?p=330</guid>
		<description><![CDATA[First create your &#8220;subdirectory_name&#8221; then run terminal and edit httpd.include (vi, pico &#8230;): pico /var/www/vhosts/domain.com/conf/httpd.include Change every &#8220;/var/www/vhosts/domain.com/httpdocs&#8221; To &#8220;/var/www/vhosts/domain.com/httpdocs/subdirectory_name&#8221; Restart apache : service httpd restart This trick can be used to configure another domain to be pointing in another domaine : exemple Change every &#8220;/var/www/vhosts/domain2.com/httpdocs&#8221; To &#8220;/var/www/vhosts/domain1.com/httpdocs&#8220;]]></description>
			<content:encoded><![CDATA[<p>First create your &#8220;subdirectory_name&#8221; then run terminal and edit httpd.include (vi, pico &#8230;):</p>
<pre class="brush: plain;">pico /var/www/vhosts/domain.com/conf/httpd.include</pre>
<p>Change every &#8220;<strong>/var/www/vhosts/domain.com/httpdocs</strong>&#8221;<br />
To &#8220;<strong>/var/www/vhosts/domain.com/httpdocs/subdirectory_name</strong>&#8221;</p>
<p>Restart apache :</p>
<pre class="brush: plain;">service httpd restart</pre>
<p>This trick can be used to configure another domain to be pointing in another domaine : exemple</p>
<p>Change every &#8220;<strong>/var/www/vhosts/<span style="color: #ff0000;">domain2.com</span>/httpdocs</strong>&#8221;<br />
To &#8220;<strong>/var/www/vhosts/<span style="color: #008000;">domain1.com</span>/httpdocs</strong><strong></strong>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/plesk-pointing-domain-subdirectory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Marquee using mootools</title>
		<link>http://updel.com/marquee-mootools/</link>
		<comments>http://updel.com/marquee-mootools/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 05:01:00 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[marquee]]></category>
		<category><![CDATA[marquee mootools]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://updel.com/?p=265</guid>
		<description><![CDATA[I think that everyone has a love story with marquee, I remember my first html page in notepad with a lot of &#60;Marquee&#62;. Today too, this tag still has the same charm, I love it. I&#8217;ve made a little class using mootools to reborn my favorite html tag. Easy to setup. Stop &#8220;onmouseover&#8221; Restart &#8220;onmouseout&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I think that everyone has a love story with <strong>marquee</strong>, I remember my first html page in notepad with a lot of <strong>&lt;Marquee&gt;</strong>.</p>
<p>Today too, this tag still has the same charm, I love it.<br />
I&#8217;ve made a little class using <strong>mootools</strong> to reborn my favorite html tag.</p>
<ul>
<li>Easy to setup.</li>
<li>Stop &#8220;onmouseover&#8221;</li>
<li>Restart &#8220;onmouseout&#8221;</li>
</ul>
<p><a class="demolink" title="Marquee using mootools" href="http://updel.com/demos/moomarquee/" target="_blank">See demo</a></p>
<p><span style="color: #ff0000;">For this moment, this class support only &#8220;slide&#8221; from right to left, I&#8217;ll add direction option when I&#8217;ve finished some works.</span></p>
<p><a class="demolink" title="Marquee using mootools" href="http://updel.com/demos/moomarquee/moomarquee.rar" target="_blank">Download script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/marquee-mootools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UTF-8 and live.com (hotmail) issue</title>
		<link>http://updel.com/php-mail-utf8/</link>
		<comments>http://updel.com/php-mail-utf8/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 02:54:17 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[function mail() encoding]]></category>
		<category><![CDATA[hotmail utf-8]]></category>
		<category><![CDATA[live.com utf-8]]></category>
		<category><![CDATA[mail() utf-8]]></category>
		<category><![CDATA[php mail utf-8]]></category>

		<guid isPermaLink="false">http://updel.com/?p=243</guid>
		<description><![CDATA[It is necessary to know first of all that: the problems with e-mails sent with UTF8 encoding  is not your, but that of the system of the addressee which does not manage correctly 8 bits,  as case of &#8220;Mail Subject&#8221; in &#8220;LIVE.com&#8221; (hotmail). The solution is encoding the data of the message in MIME base64 [...]]]></description>
			<content:encoded><![CDATA[<p>It is necessary to know first of all that: the problems with e-mails sent with UTF8 encoding  is not your, but that of the system of the addressee which does not manage correctly 8 bits,  as case of &#8220;Mail Subject&#8221; in &#8220;LIVE.com&#8221; (hotmail).</p>
<p>The solution is encoding the data of the message in MIME base64 :</p>
<p>Example :</p>
<pre class="brush: php;">
mail($emailto,&quot;=?UTF-8?B?&quot;.base64_encode($subject).&quot;?=&quot;,$message,$headers);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/php-mail-utf8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS : &#8220;float&#8221; property vs &#8220;Display:inline-block&#8221;</title>
		<link>http://updel.com/display-inline-block/</link>
		<comments>http://updel.com/display-inline-block/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:08:48 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[display:inline-block]]></category>
		<category><![CDATA[FLOAT vs Display:inline-block]]></category>
		<category><![CDATA[vertical-align]]></category>

		<guid isPermaLink="false">http://updel.com/?p=228</guid>
		<description><![CDATA[I confess that I&#8217;ve never worked with the CSS attribute &#8220;display: inline-block&#8220;, I thank Firebug and error in the Live.com site for this discovery. This property allows to apply two kinds of &#8220;display&#8221; for the same element, in addition there is an equivalent for FireFox as well, namely &#8220;display:-moz-inline-box&#8220;. Example : #content div.left{ width:180px; display:-moz-inline-box; [...]]]></description>
			<content:encoded><![CDATA[<p>I confess that I&#8217;ve never worked with the CSS attribute &#8220;<strong>display: inline-block</strong>&#8220;, I thank Firebug and error in the Live.com site for this discovery.</p>
<p>This property allows to apply two kinds of &#8220;<strong>display</strong>&#8221; for the same element, in addition there is an equivalent for FireFox as well, namely &#8220;<strong>display:-moz-inline-box</strong>&#8220;.</p>
<p><strong>Example :</strong></p>
<pre class="brush: css;">
#content div.left{
	width:180px;
	display:-moz-inline-box;
	display:inline-block;
}
/* Hack for IE */
* html #content div.left{
	display:inline;
}
</pre>
<p><strong>Another advantages :</strong><br />
Consideration of the property &#8220;<strong>vertical-align</strong>&#8220;.<br />
Ability to leave free the height of the element, unlike &#8220;float&#8221;.</p>
<p><a class="demolink" title="CSS display:inline-block" href="http://updel.com/demos/inline-block/" target="_blank">See layout demo</a></p>
<p><a class="demolink" title="CSS display:inline-block" href="http://updel.com/demos/inline-block/articles.html" target="_blank">See &#8220;float:left&#8221; vs &#8220;display:block-inline&#8221; fight</a></p>
<p>Are you ready to kill FLOAT ??</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/display-inline-block/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL_CALC_FOUND_ROWS vs mysql_num_rows()</title>
		<link>http://updel.com/sql_calc_found_rows-vs-mysql_num_rows/</link>
		<comments>http://updel.com/sql_calc_found_rows-vs-mysql_num_rows/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 03:50:19 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[mysql_num_rows()]]></category>
		<category><![CDATA[SQL_CALC_FOUND_ROWS]]></category>

		<guid isPermaLink="false">http://updel.com/?p=169</guid>
		<description><![CDATA[What function do you use to return the number of records in a MYSQL table and why? To understand the difference between SQL_CALC_FOUND_ROWS and mysql_num_rows() $sql = mysql_query(&#34; SELECT SQL_CALC_FOUND_ROWS id FROM table WHERE id_msg = 2 &#34;); $pages_resultats = mysql_query(&#34;SELECT FOUND_ROWS()&#34;); list($nbr_resultats) = mysql_fetch_array($pages_resultats); Resultats : echo mysql_num_rows($sql); // Return 4 echo $nbr_resultats; // [...]]]></description>
			<content:encoded><![CDATA[<p>What function do you use to return the number of records in a MYSQL table and why?<br />
To understand the difference between <a title="SQL_CALC_FOUND_ROWS" href="http://dev.mysql.com/doc/refman/5.0/fr/information-functions.html" target="_blank">SQL_CALC_FOUND_ROWS</a> and <a title="mysql_num_rows()" href="http://www.php.net/manual/fr/function.mysql-num-rows.php" target="_blank">mysql_num_rows()</a></p>
<p><img class="aligncenter size-full wp-image-170" title="Untitled-1" src="http://updel.com/wp-content/uploads/Untitled-1.jpg" alt="sql_calc_found_rows" width="92" height="138" /></p>
<pre class="brush: php;">
$sql  = mysql_query(&quot;
                              SELECT      SQL_CALC_FOUND_ROWS id
                              FROM        table
                              WHERE       id_msg  =  2
                            &quot;);
$pages_resultats	=	mysql_query(&quot;SELECT FOUND_ROWS()&quot;);
list($nbr_resultats) = mysql_fetch_array($pages_resultats);
</pre>
<p><strong>Resultats :</strong></p>
<pre class="brush: php;">
echo mysql_num_rows($sql); // Return 4
echo $nbr_resultats; // Return 4
</pre>
<p><span style="color: #ff0000;"><strong>Now add &#8220;Limit&#8221; to query and retry :</strong></span></p>
<pre class="brush: php;">
$sql  = mysql_query(&quot;
                              SELECT      SQL_CALC_FOUND_ROWS id
                              FROM        table
                              WHERE       id_msg  =  2
                              LIMIT       2
                            &quot;);
$pages_resultats	=	mysql_query(&quot;SELECT FOUND_ROWS()&quot;);
list($nbr_resultats) = mysql_fetch_array($pages_resultats);
</pre>
<p><strong>Resultats :</strong></p>
<pre class="brush: php;">
echo mysql_num_rows($sql); // Return 2
echo $nbr_resultats; // Return always 4
</pre>
<p>Unlike mysql_num_rows() or COUNT(), the function SQL_CALC_FOUND_ROWS is not affected by the LIMIT clause.<br />
<strong>SQL_CALC_FOUND_ROWS</strong> is ideal for paging navigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/sql_calc_found_rows-vs-mysql_num_rows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check if &#8220;is digits&#8221; and does not begin with zero</title>
		<link>http://updel.com/validate-digits-php/</link>
		<comments>http://updel.com/validate-digits-php/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 12:35:07 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[AUTO_INCREMENT]]></category>
		<category><![CDATA[is_digits()]]></category>
		<category><![CDATA[is_numeric()]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Protecting mysql Injection]]></category>
		<category><![CDATA[Validating digits]]></category>

		<guid isPermaLink="false">http://updel.com/?p=152</guid>
		<description><![CDATA[Protecting Your PHP/SQL Queries from SQL Injection is one of coding obligations, if you have tables with AUTO_INCREMENT and you want to check IDs before running queries, this function is yours. function is_digits($string){ return preg_match(&#34;!^[1-9]([0-9]+)?$!&#34;,$string); } Examples : is_digits(0); // Return 0 is_digits(1); // Return 1 is_digits(&#34;1&#34;); // Return 1 is_digits(01); // Return 0 is_digits(-1); [...]]]></description>
			<content:encoded><![CDATA[<p>Protecting Your PHP/SQL Queries from SQL Injection is one of coding obligations, if you have tables with AUTO_INCREMENT and you want to check IDs before running queries, this function is yours.</p>
<pre class="brush: php;">
function is_digits($string){
	return preg_match(&quot;!^[1-9]([0-9]+)?$!&quot;,$string);
}
</pre>
<p><strong>Examples :</strong></p>
<pre class="brush: php;">
is_digits(0); // Return 0
is_digits(1); // Return 1
is_digits(&quot;1&quot;); // Return 1
is_digits(01); // Return 0
is_digits(-1); // Return 0
is_digits(&quot;1a&quot;); // Return 0
is_digits(&quot;a1&quot;); // Return 0
is_digits(15); // Return 1
is_digits(1,5); // Return 0
is_digits(1.5); // Return 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/validate-digits-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mysql FIND_IN_SET()</title>
		<link>http://updel.com/find_in_set/</link>
		<comments>http://updel.com/find_in_set/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:53:45 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[FIND_IN_SET()]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://updel.com/?p=116</guid>
		<description><![CDATA[FIND_IN_SET() : A function that I discovered some years ago and which I find very impressive if you&#8217;re addicted to query optimization. This function is a bit like in_array() but is doing research in StringList separated by commas &#8220;,&#8221; Here is an example to understand: Table : Clubs Table : Leagues To select leagues which [...]]]></description>
			<content:encoded><![CDATA[<p><a title="find_in_set()" href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set" target="_blank">FIND_IN_SET()</a> : A function that I discovered some years ago and which I find very impressive if you&#8217;re addicted to query optimization.<br />
This function is a bit like <a title="in_array" href="http://www.php.net/in_array" target="_blank">in_array()</a> but is doing research in StringList separated by commas &#8220;,&#8221;</p>
<p>Here is an example to understand:</p>
<p>Table : <strong>Clubs</strong><br />
<img class="size-full wp-image-126 alignnone" title="table_clubs" src="http://updel.com/wp-content/uploads/table_clubs1.gif" alt="table_clubs" width="183" height="89" /></p>
<p>Table : <strong>Leagues</strong><br />
<img title="championnats" src="http://updel.com/wp-content/uploads/championnats.gif" alt="championnats" width="462" height="107" /></p>
<p>To select leagues which participates BARCA (having id 11), SQL code would look like this :</p>
<pre class="brush: sql;">
SELECT    league_id,name
FROM      Leagues
WHERE     FIND_IN_SET(11, clubs_id)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/find_in_set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a new directory having 0777 permissions</title>
		<link>http://updel.com/new-directory-777/</link>
		<comments>http://updel.com/new-directory-777/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 03:25:14 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[ftp_mkdir()]]></category>
		<category><![CDATA[mkdir()]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://updel.com/?p=83</guid>
		<description><![CDATA[I need to create unique directory for every new member, which will be used to store their pictures. I&#8217;ve tried : mkdir(&#34;user_name&#34;, 0777); I got : mkdir() [function.mkdir]: Permission denied It work when I chmod parent directory but can not give permissions “0777”, therefore I add umask() umask(000); mkdir(&#34;user_name&#34;, 0777); Eurêka BUT ! the new [...]]]></description>
			<content:encoded><![CDATA[<p>I need to create unique directory for every new member, which will be used to store their pictures. I&#8217;ve tried :</p>
<pre class="brush: php;">mkdir(&quot;user_name&quot;, 0777);</pre>
<p>I got : <strong>mkdir() [function.mkdir]: Permission denied</strong></p>
<p>It work when I chmod parent directory but can not give permissions “0777”, therefore I add <a title="umask() documentation" href="http://php.net/manual/en/function.umask.php" target="_blank">umask()</a></p>
<pre class="brush: php;">
umask(000);
mkdir(&quot;user_name&quot;, 0777);
</pre>
<p><strong>Eurêka <span style="color: #ff0000;">BUT !</span></strong> the new folder is now owned by mr apache</p>
<p><strong><span style="color: #ff0000;"> </span></strong><img class="aligncenter size-full wp-image-103" title="Owned by apache" src="http://updel.com/wp-content/uploads/Untitled-1.gif" alt="Owned by apache" width="405" height="243" /></p>
<p>Now imagine that we want to create a subfolder like “user_name/gallery” ! we will get an error like :</p>
<blockquote><p><strong>Warning</strong>:  mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is XXX is not allowed to access /var/www/vhosts/updel.com/httpdocs/test/test owned by uid 48 in <strong>/var/www/vhosts/updel.com/httpdocs/test.php</strong> on line <strong>4</strong></p></blockquote>
<p>It mean we do not have permission to touch a directory owned by another user !!!!!!!!</p>
<p><strong><span style="color: #ff0000;">The solution</span></strong> : <strong>FORGET mkdir() </strong>and through ftp using PHP, the code look like this</p>
<pre class="brush: php;">
$connexion_ftp = ftp_connect(&quot;Ftp_url&quot;); //Connexion ftp
ftp_login($connexion_ftp, &quot;Ftp_login&quot;, &quot;Ftp_Password&quot;);
ftp_mkdir($connexion_ftp, &quot;new_dir&quot;); // user_name in my case
ftp_site($connexion_ftp,&quot;CHMOD 777 new_dir&quot;);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/new-directory-777/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP cli progress Bar</title>
		<link>http://updel.com/php-console-progress-bar/</link>
		<comments>http://updel.com/php-console-progress-bar/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 16:25:11 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Progress bar]]></category>

		<guid isPermaLink="false">http://updel.com/?p=14</guid>
		<description><![CDATA[This is a simple trick to make your PHP console application more funny function progress($seconds =10){ $seconds  = (isset($seconds ) and (int)$seconds )  ? $seconds *4 : 40; echo &#34;\t[+] &#34;.str_repeat(&#34;²&#34;, $seconds ); for($i=0;$i&#60;=$seconds ;$i++)    { $fonce = str_repeat(&#34;Û&#34;, $i); print &#34;\r\t[+] &#34;.$fonce; usleep(250000); } } Progress bar will appear by calling the function and [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple trick to make your PHP console application more funny</p>
<div style="text-align:center">		<object type="application/x-shockwave-flash" width="425" height="344" data="http://www.youtube.com/v/3CPhtiChOOc&amp;hl=en&amp;fs=1&amp;"><param name="movie" value="http://www.youtube.com/v/3CPhtiChOOc&amp;hl=en&amp;fs=1&amp;" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /></object></div>
<p><span id="more-14"></span></p>
<pre class="brush: php;">
function progress($seconds =10){
$seconds  = (isset($seconds ) and (int)$seconds )  ? $seconds *4 : 40;
echo &quot;\t[+] &quot;.str_repeat(&quot;²&quot;, $seconds );
for($i=0;$i&lt;=$seconds ;$i++)    {
$fonce = str_repeat(&quot;Û&quot;, $i);
print &quot;\r\t[+] &quot;.$fonce;
usleep(250000);
}
}
</pre>
<p>Progress bar will appear by calling the function and number of seconds (10 in my case) :</p>
<pre class="brush: php;">print progress(10); //print is optional</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/php-console-progress-bar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

