<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5431265932220094605</id><updated>2024-09-19T02:34:57.438-07:00</updated><category term="php"/><category term="ubuntu"/><category term="zend framework"/><category term="firefox"/><category term="iphone"/><category term="linux"/><category term="mobile"/><category term="svn"/><category term="user agent"/><category term="wordpess"/><category term="28jan"/><category term="Web"/><category term="addon"/><category term="apache"/><category term="bad superblock"/><category term="blackberry"/><category term="expose_php"/><category term="facebook"/><category term="get header"/><category term="google"/><category term="honeypot"/><category term="internet errors"/><category term="ipod"/><category term="java"/><category term="joomla"/><category term="joomla1.7"/><category term="lamp"/><category term="last modification time"/><category term="library"/><category term="meta"/><category term="meta tags"/><category term="module"/><category term="modules"/><category term="php 5.4"/><category term="php configuration"/><category term="skype"/><category term="spaghetti"/><category term="spam."/><category term="stripos"/><category term="strpos"/><category term="tags"/><category term="web security"/><category term="wp_options"/><title type='text'>Php and the City</title><subtitle type='html'>You will find all about Php , Zend Framework , and a lot more of free tutorials , tricks , freebies and howtos.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-7407109991468428173</id><published>2013-11-03T02:49:00.001-08:00</published><updated>2013-11-03T02:50:25.891-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="skype"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Make Skype working on Linux Ubuntu 13.10 64bit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If you have a fresh install or an upgrade to Ubuntu 13.10 , you may encounter some difficulties on skype, whatever your pc or laptop is.&lt;br /&gt;
You may also download skype from its website and find it working perfectly , but if you get all sounds on skype distorted or no sound at all , then here is the solution .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Remove any installation of skype&amp;nbsp;
&lt;pre class=&quot;brush: php&quot;&gt;sudo apt-get remove skype
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Open &quot;Software &amp;amp; Updates&quot; and enable the &quot;Canonical Partners&quot; repository.
Open Terminal or Alt+F2 and type
&lt;pre class=&quot;brush: php&quot;&gt;software-properties-gtk
&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBm0EghZndq_48TJXqbgOkbe3_H379EsEdC8OPip4Q0lyQHrpEwonzsuEMKtsciwD1i-r40unGY_MnvkIkvRGvxGEVZW1cU-D7AUbVuKZ9f_fFlGv8rHtYGSMKBOcK9UYZ5tENpexJjBUL/s1600/canonical-partners-repository.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;85&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBm0EghZndq_48TJXqbgOkbe3_H379EsEdC8OPip4Q0lyQHrpEwonzsuEMKtsciwD1i-r40unGY_MnvkIkvRGvxGEVZW1cU-D7AUbVuKZ9f_fFlGv8rHtYGSMKBOcK9UYZ5tENpexJjBUL/s320/canonical-partners-repository.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Update and install skype
&lt;pre class=&quot;brush: php&quot;&gt;sudo apt-get update
sudo apt-get install skype
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Run this command&amp;nbsp;
&lt;pre class=&quot;brush: php&quot;&gt;sudo sed -i &#39;s/^Exec=.*/Exec=env PULSE_LATENCY_MSEC=30 skype %U/&#39; /usr/share/applications/skype.desktop&lt;/pre&gt;
&lt;div&gt;
This is a workaround t get skype working with PulseAudio 4.0.&lt;br /&gt;
In any shortcut of skype , or if you want to run it from terminal just add(&amp;nbsp;PULSE_LATENCY_MSEC=30 )&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/7407109991468428173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2013/11/make-skype-working-on-linux-ubuntu-1310.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7407109991468428173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7407109991468428173'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2013/11/make-skype-working-on-linux-ubuntu-1310.html' title='Make Skype working on Linux Ubuntu 13.10 64bit'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBm0EghZndq_48TJXqbgOkbe3_H379EsEdC8OPip4Q0lyQHrpEwonzsuEMKtsciwD1i-r40unGY_MnvkIkvRGvxGEVZW1cU-D7AUbVuKZ9f_fFlGv8rHtYGSMKBOcK9UYZ5tENpexJjBUL/s72-c/canonical-partners-repository.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-5479582451827702529</id><published>2012-12-09T04:58:00.001-08:00</published><updated>2012-12-09T05:00:50.140-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><title type='text'>Use @font-face with an Arabic Font </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Now you can add an arabic font to your css , and make all you arabic web pages look the same at all browsers that support ( @font-face ) .&lt;br /&gt;
Download Amiri Font from here ( &amp;nbsp;&lt;a href=&quot;http://www.amirifont.org/&quot;&gt;http://www.amirifont.org/&lt;/a&gt;&amp;nbsp;) and enjoy creating arabic websites .&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/5479582451827702529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/12/use-font-face-with-arabic-font.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5479582451827702529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5479582451827702529'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/12/use-font-face-with-arabic-font.html' title='Use @font-face with an Arabic Font '/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-8174941726082067944</id><published>2012-11-04T04:08:00.000-08:00</published><updated>2012-11-04T04:08:42.322-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Introductive Guide for using Facebook php sdk </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In this post I will explain how to connect your website visitors with their Facebook accounts , so you don&#39;t need to prompt your users with registration forms or login forms , just a button to login with Facebook or connect with Facebook and you are done .&lt;br /&gt;
You can save your users Facebook data in your database , also you can save their Facebook login status in cookies not to prompt them every time with the login dialog .&lt;br /&gt;
&lt;br /&gt;
I will also explain how to post on Facebook users timeline , also post on the pages they own ( or the pages in which they are admin ) .&lt;br /&gt;
Also the post can include photos or videos like any post you put on facebook.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s begin .&lt;br /&gt;
First you have to create a new app , go to &lt;a href=&quot;http://developers.facebook.com/apps&quot;&gt;http://developers.facebook.com/apps&lt;/a&gt; and then click on &quot;Create New App&quot; button , choose a unique name and then click Create .&lt;br /&gt;
You can choose free webhosting if you don&#39;t have a host .&lt;br /&gt;
&lt;br /&gt;
You will be redirected to a page where you can edit your app settings , to visit this page again , you can go to &lt;a href=&quot;http://developers.facebook.com/apps&quot;&gt;http://developers.facebook.com/apps&lt;/a&gt; you will find your apps on the left , and Edit Settings link on the right .&lt;br /&gt;
&lt;br /&gt;
The first page is Basic page , you can edit general information about your app , the most important thing you have to check is &quot;App Domains&quot; , you can enter several domains , but you must have control on them.&lt;br /&gt;
Also in the Basic page you have you app ID and app Secret , grab them and save them for now .&lt;br /&gt;
&lt;br /&gt;
The second page is Basic &amp;gt; Permissions , you have 2 fields to edit ( User &amp;amp; Friend Permissions ) and ( Extended Permissions ) , you will find a list of available permissions here ( &lt;a href=&quot;http://developers.facebook.com/docs/reference/login/#permissions&quot;&gt;http://developers.facebook.com/docs/reference/login/#permissions&lt;/a&gt; ) .&lt;br /&gt;
&lt;br /&gt;
If you need access to the users friends list , you have to add &lt;b&gt;read_friendlists&lt;/b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;to extended permissions .&lt;br /&gt;
If you want to post on their behalf , you should add &lt;b&gt;publish_stream&lt;/b&gt; .&lt;br /&gt;
And if you need to manage their pages , you have to add &lt;b&gt;manage_pages&lt;/b&gt; to extended permissions.&lt;br /&gt;
&lt;br /&gt;
Go now and download from github the facebook php sdk ( &lt;a href=&quot;https://github.com/facebook/facebook-php-sdk&quot;&gt;https://github.com/facebook/facebook-php-sdk&lt;/a&gt; ) , copy the src folder to somewhere included in your website .&lt;br /&gt;
&lt;br /&gt;
Go to your index.php page , or any page you need to be accessed by facebook and type the following.&lt;br /&gt;
First include facebook sdk file&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;require_once &#39;src/facebook.php&#39; ;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
Next create new instance from this class&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$facebook = new Facebook(array(&#39;appId&#39; =&amp;gt;APP_ID,
&#39;secret&#39; =&amp;gt;APP_SECRET
));
&lt;/pre&gt;
APP_ID and APP_SECRET can be got from the basic page of your facebook app ( &lt;a href=&quot;http://developers.facebook.com/apps&quot;&gt;http://developers.facebook.com/apps&lt;/a&gt; ) .&lt;br /&gt;
&lt;br /&gt;
Second you need to check if the user is logged in and has authorised your application or not , this can be done using the following line .&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$facebook-&amp;gt;getUser();
&lt;/pre&gt;
This function check if the user is logged in and authorised to your app or not , and is saving the logging data in session&lt;br /&gt;
If the user is not logged in , we should print a login url to connect the user with facebook .&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;if(!$facebook-&amp;gt;getUser()){
printf(&#39;&lt;a href=&quot;http://www.blogger.com/%s&quot;&gt;Connect With Facebook&lt;/a&gt;&#39;) , $facebook-&amp;gt;getLoginUrl(array(&quot;scope&quot; =&amp;gt; &quot;manage_pages,publish_stream&quot;)));
}
&lt;/pre&gt;
You should add the scope ( or the permissions ) you have included from the settings page in your app , in the login url that the user will go and click and authorise your app , so he ( the user ) will authorise your app for the permissions included .&lt;br /&gt;
&lt;br /&gt;
The user should be prompted with something like that .&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2WUYvLEyJzNE48Z2ehYAzzDVS1zh2VoQhe8ENCw9OCXrLGVMV6kEQYK50UJis8LFUYo54Fk3cpKbqJdBuvfPnFDDgluPOagB1CcJgjXO2ZTt-716MOrxGEz8ZKNQBO2vI7NKQw5NV6X4J/s1600/Screenshot+from+2012-11-03+21:15:12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;171&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2WUYvLEyJzNE48Z2ehYAzzDVS1zh2VoQhe8ENCw9OCXrLGVMV6kEQYK50UJis8LFUYo54Fk3cpKbqJdBuvfPnFDDgluPOagB1CcJgjXO2ZTt-716MOrxGEz8ZKNQBO2vI7NKQw5NV6X4J/s320/Screenshot+from+2012-11-03+21:15:12.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
If the user authorised your app , he should be redirected back to your website so you can check again if he logged in or not.&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;if(!$facebook-&amp;gt;getUser()){
printf(&#39;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=5431265932220094605&quot;&gt;Connect With Facebook&lt;/a&gt;&#39;) , $facebook-&amp;gt;getLoginUrl(array(&quot;scope&quot; =&amp;gt; &quot;manage_pages,publish_stream&quot;)));
} else {
// the user is logged in and authorised the app
// we can grab the user account data .
$userData = $facebook&amp;gt;api(&#39;/me&#39;);
printf ( &#39;Welcome %s&#39; , $userData[&quot;name&quot;]);
}
&lt;/pre&gt;
If you need to publish a post on behalf of the user , remember that you need &quot;publish_stream&quot; permission&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$params = array(&quot;message&quot; =&amp;gt; &quot;Testing the new facebook sdk&quot;);
$facebook-&amp;gt;api(&quot;USER_ID/feed&quot; , &#39;POST&#39; , $params);
&lt;/pre&gt;
You can get User_ID from $userData ( $facebook-&amp;gt;api(&#39;/me&#39;) );&lt;br /&gt;
$params is associative array of the post parameters , you can get full description of the parameters here ( &lt;a href=&quot;https://developers.facebook.com/docs/reference/api/post/&quot;&gt;https://developers.facebook.com/docs/reference/api/post/&lt;/a&gt; ) .&lt;br /&gt;
&lt;br /&gt;
If you need a list of the pages the user owns or admins&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$pages = $facebook-&amp;gt;api(&quot;/me/accounts&quot;);
&lt;/pre&gt;
I hope that will be useful for anyone want to use the facebook php sdk .&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/8174941726082067944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/11/introductive-guide-for-using-facebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8174941726082067944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8174941726082067944'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/11/introductive-guide-for-using-facebook.html' title='Introductive Guide for using Facebook php sdk '/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2WUYvLEyJzNE48Z2ehYAzzDVS1zh2VoQhe8ENCw9OCXrLGVMV6kEQYK50UJis8LFUYo54Fk3cpKbqJdBuvfPnFDDgluPOagB1CcJgjXO2ZTt-716MOrxGEz8ZKNQBO2vI7NKQw5NV6X4J/s72-c/Screenshot+from+2012-11-03+21:15:12.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-8250996170994979291</id><published>2012-11-01T11:40:00.001-07:00</published><updated>2012-11-01T11:40:36.256-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lamp"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Easiest way to install LAMP on ubuntu ( using task-sel )</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is the easiest way to install LAMP on linux &lt;a href=&quot;http://www.phpandthecity.com/search/label/ubuntu&quot; target=&quot;_blank&quot;&gt;ubuntu&lt;/a&gt;&amp;nbsp;, using only one or two commands from your terminal . Open your terminal and type the following :&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;sudo apt-get install task-sel&lt;/pre&gt;
&lt;br /&gt;
That will install Task Selector , with which you can install a bunch of services on Ubuntu .&lt;br /&gt;
After completing the installation , type the following&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;sudo task-sel&lt;/pre&gt;
&lt;br /&gt;
You will find the terminal changing to the following&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRKF_qYZkjfEYPBGMVpjTV9Wk3lbmBZvJV3YvwgdTPsDukivui0i5_qXwzjbHw4s4JxoPqAC3bVtGv-Wvo_OM1wjDWv7eX5m_yabep5gUxaQ4aV4jNUZkrihQuUpP5BTobXqVX4umxnMvC/s1600/Screenshot+from+2012-11-01+20:32:35.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;167&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRKF_qYZkjfEYPBGMVpjTV9Wk3lbmBZvJV3YvwgdTPsDukivui0i5_qXwzjbHw4s4JxoPqAC3bVtGv-Wvo_OM1wjDWv7eX5m_yabep5gUxaQ4aV4jNUZkrihQuUpP5BTobXqVX4umxnMvC/s320/Screenshot+from+2012-11-01+20:32:35.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Select &quot;LAMP server&quot; package ( press space to select ) and press OK ( press tab and then enter ) .&lt;br /&gt;
The packages will be downloaded ( apache , php and mysql ) and then they will be installed , the mysql &amp;nbsp;installation will prompt to you to choose the root password .&lt;br /&gt;
&lt;br /&gt;
That&#39;s it , you now have a full working LAMP server.&lt;br /&gt;
&lt;br /&gt;
You can also install phpmyadmin by typing the following&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;sudo apt-get install phpmyadmin&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/8250996170994979291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/11/easiest-way-to-install-lamp-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8250996170994979291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8250996170994979291'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/11/easiest-way-to-install-lamp-on-ubuntu.html' title='Easiest way to install LAMP on ubuntu ( using task-sel )'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRKF_qYZkjfEYPBGMVpjTV9Wk3lbmBZvJV3YvwgdTPsDukivui0i5_qXwzjbHw4s4JxoPqAC3bVtGv-Wvo_OM1wjDWv7eX5m_yabep5gUxaQ4aV4jNUZkrihQuUpP5BTobXqVX4umxnMvC/s72-c/Screenshot+from+2012-11-01+20:32:35.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-6341490782804620393</id><published>2012-10-31T08:01:00.001-07:00</published><updated>2012-10-31T08:04:02.273-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Upgrade Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If you want to upgrade your ubuntu version to the 12.0 ( Quantal Quetzal ) , make sure you have a working internet connection , then open your terminal or command window ( Alt+F2 ) and type&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;update-manager -d
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzKeSHXNxl5Rub4qNZfzzJ1cYrT5AC4hDNd2ulW_62ghy2LrvH3juGLNxj71O9ApbyrVER9S1w_lVbteySl545ra38QEdVO87dkJA9VSStcZOkUD7-aBgECfZ_P9euHJfAdZ-mod_5_zyU/s1600/Screenshot+from+2012-10-31+16:55:54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzKeSHXNxl5Rub4qNZfzzJ1cYrT5AC4hDNd2ulW_62ghy2LrvH3juGLNxj71O9ApbyrVER9S1w_lVbteySl545ra38QEdVO87dkJA9VSStcZOkUD7-aBgECfZ_P9euHJfAdZ-mod_5_zyU/s320/Screenshot+from+2012-10-31+16:55:54.png&quot; width=&quot;297&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The update manager will open and you will find a new box for the upgrade , click &quot;upgrade&quot; and relax ; it will take some time not like installing a fresh version.&lt;br /&gt;
&lt;br /&gt;
This way has been useful with me for upgrading ubuntu for several versions , and I think it will be the same afterwards for upgrading for each new version for ubuntu.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/6341490782804620393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/10/upgrade-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6341490782804620393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6341490782804620393'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/10/upgrade-ubuntu.html' title='Upgrade Ubuntu'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzKeSHXNxl5Rub4qNZfzzJ1cYrT5AC4hDNd2ulW_62ghy2LrvH3juGLNxj71O9ApbyrVER9S1w_lVbteySl545ra38QEdVO87dkJA9VSStcZOkUD7-aBgECfZ_P9euHJfAdZ-mod_5_zyU/s72-c/Screenshot+from+2012-10-31+16:55:54.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-8562986211135413387</id><published>2012-06-10T06:20:00.000-07:00</published><updated>2012-06-10T06:20:11.756-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php 5.4"/><title type='text'>What Every Developer Must Know About PHP 5.4</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;This article is a very helpful brief about the new features in php 5.4&lt;br /&gt;
&lt;a href=&quot;http://bit.ly/MwG6Xe&quot;&gt;http://bit.ly/MwG6Xe&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/8562986211135413387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/what-every-developer-must-know-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8562986211135413387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8562986211135413387'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/what-every-developer-must-know-about.html' title='What Every Developer Must Know About PHP 5.4'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-6783910877209731931</id><published>2012-06-06T10:38:00.000-07:00</published><updated>2012-06-06T10:38:10.370-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="expose_php"/><category scheme="http://www.blogger.com/atom/ns#" term="php configuration"/><category scheme="http://www.blogger.com/atom/ns#" term="web security"/><title type='text'>Php Configuration : expose_php</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I have read about this in Apress ( Apress Beginning PHP and MySQL From Novice to Professional ) , Chapter 21 ( Securing Your Web Site )&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Each scrap of information that a potential attacker can gather about a web server increases the&lt;br /&gt;chances that he will successfully compromise it. One simple way to obtain key information about server&lt;br /&gt;characteristics is via the server signature.&lt;br /&gt;For example, Apache will broadcast the following information&lt;br /&gt;within each response header by default:&lt;br /&gt;Apache/2.2.0 (Unix) PHP/5.3.0 PHP/5.3.0-dev Server at www.example.com Port 80&lt;br /&gt;Disabling expose_php prevents the web server signature (if enabled) from broadcasting the fact that&lt;br /&gt;PHP is installed. Although you need to take other steps to ensure sufficient server protection, obscuring&lt;br /&gt;server properties such as this one is nonetheless heartily recommended.&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;
Simply this information you won&#39;t use if you are working on a shared hosting , or working locally on you machine, but if you manage to create your own servers, you would rather disable expose_php .&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/6783910877209731931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/php-configuration-exposephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6783910877209731931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6783910877209731931'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/php-configuration-exposephp.html' title='Php Configuration : expose_php'/><author><name>BaBaNesmA</name><uri>http://www.blogger.com/profile/00397132365607730661</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='21' src='http://img220.imageshack.us/img220/9178/image63lu7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-4348034293452016254</id><published>2012-06-03T12:20:00.001-07:00</published><updated>2012-06-03T12:20:15.121-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Simply Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
First Book in arabic to explain How to install Ubuntu and work with ubuntu .&lt;br /&gt;
I am really proud of it&lt;br /&gt;
Please visit&amp;nbsp;&lt;a href=&quot;http://www.simplyubuntu.com/&quot;&gt;http://www.simplyubuntu.com/&lt;/a&gt;&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/4348034293452016254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/simply-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/4348034293452016254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/4348034293452016254'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/06/simply-ubuntu.html' title='Simply Ubuntu'/><author><name>BaBaNesmA</name><uri>http://www.blogger.com/profile/00397132365607730661</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='21' src='http://img220.imageshack.us/img220/9178/image63lu7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-287886884083676925</id><published>2012-02-15T04:29:00.000-08:00</published><updated>2012-02-15T04:29:18.273-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="honeypot"/><category scheme="http://www.blogger.com/atom/ns#" term="spam."/><category scheme="http://www.blogger.com/atom/ns#" term="wordpess"/><title type='text'>Honeypot , to catch spam bots</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;This is a wordpress plugin (&amp;nbsp;&lt;a href=&quot;http://wordpress.org/extend/plugins/contact-form-7-honeypot/&quot;&gt;http://wordpress.org/extend/plugins/contact-form-7-honeypot/&lt;/a&gt;&amp;nbsp;) , it adds a hidden form input field , in your contact form , so the spam bots will fill it automatically , but the form submission will fail if you fill it .&lt;br /&gt;
&lt;br /&gt;
Usually normal users will not see this empty hidden field , and so their submission will be correct .&lt;br /&gt;
&lt;br /&gt;
Surely , the same concept can be applied in any form not only wordpress forms.&lt;br /&gt;
I have first read about this in Lornajane blog (&amp;nbsp;&lt;a href=&quot;http://www.lornajane.net/posts/2012/wordpress-contact-form-7-without-captcha&quot;&gt;http://www.lornajane.net/posts/2012/wordpress-contact-form-7-without-captcha&lt;/a&gt;&amp;nbsp;) .&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/287886884083676925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/02/honeypot-to-catch-spam-bots.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/287886884083676925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/287886884083676925'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/02/honeypot-to-catch-spam-bots.html' title='Honeypot , to catch spam bots'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-6970399860201025692</id><published>2012-02-02T10:54:00.000-08:00</published><updated>2012-02-02T10:54:36.738-08:00</updated><title type='text'>The Shapes of CSS</title><content type='html'>&lt;a href=&quot;http://css-tricks.com/examples/ShapesOfCSS/&quot;&gt;The Shapes of CSS&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This link is so useful , with which you can draw any shape you want with just pure css.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/6970399860201025692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2012/02/shapes-of-css.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6970399860201025692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6970399860201025692'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2012/02/shapes-of-css.html' title='The Shapes of CSS'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-2929636851873385914</id><published>2011-09-13T08:56:00.000-07:00</published><updated>2011-09-13T08:56:13.703-07:00</updated><title type='text'>Blogger Buzz: Announcing the Blogger app for iOS</title><content type='html'>I think I should buy a new smart phone&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://buzz.blogger.com/2011/09/announcing-blogger-app-for-ios.html?spref=bl&quot;&gt;Blogger Buzz: Announcing the Blogger app for iOS&lt;/a&gt;: Today we’re excited to announce the new Blogger app for iOS. With the Blogger app, you can write a new blog post and publish it immediately ...</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/2929636851873385914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/09/blogger-buzz-announcing-blogger-app-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/2929636851873385914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/2929636851873385914'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/09/blogger-buzz-announcing-blogger-app-for.html' title='Blogger Buzz: Announcing the Blogger app for iOS'/><author><name>BaBaNesmA</name><uri>http://www.blogger.com/profile/00397132365607730661</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='21' src='http://img220.imageshack.us/img220/9178/image63lu7.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-8327828956134109672</id><published>2011-08-24T04:03:00.000-07:00</published><updated>2011-08-24T04:03:16.015-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wordpess"/><category scheme="http://www.blogger.com/atom/ns#" term="wp_options"/><title type='text'>Copy wordpress from local to online</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I have installed wordpress latest version (3.2.1) &amp;nbsp;, on my local machine , and then uploaded it to a host , when I go to the admin panel , it keeps redirecting me to the local address .&lt;br /&gt;
&lt;br /&gt;
After debugging , I discovered that wordpress stores some info in a configuration file , and other info in database , and I have uploaded the database as it is .&lt;br /&gt;
&lt;br /&gt;
To solve this problem , I open phpmyadmin on the host server , and I changed the site_url option to the correct one , from table wp_options .&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/8327828956134109672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/08/copy-wordpress-from-local-to-online.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8327828956134109672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8327828956134109672'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/08/copy-wordpress-from-local-to-online.html' title='Copy wordpress from local to online'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-7877156087230255674</id><published>2011-08-24T03:56:00.000-07:00</published><updated>2011-08-24T03:57:33.092-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="joomla"/><category scheme="http://www.blogger.com/atom/ns#" term="joomla1.7"/><category scheme="http://www.blogger.com/atom/ns#" term="module"/><title type='text'>Create a new module on joomla 1.7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I moved to joomla to make a small job .&lt;br /&gt;
I needed to make a new module to make things customizable on the home page ,&amp;nbsp; but it seems that joomla 1.7 uses a new way to make modules, rather than the one described in their documentation ( &lt;a href=&quot;http://docs.joomla.org/Creating_a_simple_module&quot;&gt;click here&lt;/a&gt; ) .&lt;br /&gt;
&lt;br /&gt;
You will make everything as the tutorial said , except some small changes in the xml file .&lt;br /&gt;
To add files and folders , you don&#39;t need to write all files in each folder but you can include a complete folder in a way like that&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&lt;files&gt;
	&lt;filename module=&quot;mod_hello_world&quot;&gt;mod_hello_world.php&lt;/filename&gt;
	&lt;filename&gt;index.html&lt;/filename&gt;
	&lt;folder&gt;tmpl&lt;/folder&gt;
	&lt;filename&gt;mod_hello_world.xml&lt;/filename&gt;
&lt;/files&gt;
&lt;/pre&gt;When you write &lt;folder&gt;tmpl&lt;/folder&gt; , all files inside this folder are automatically included .&lt;br /&gt;
Also you will have to take care when you include parameters , there is a new way to do that&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&lt;config&gt;
 &lt;fields name=&quot;params&quot;&gt;
  &lt;fieldset name=&quot;basic&quot;&gt;   &lt;field description=&quot;Param 1 Description&quot; label=&quot;Param1&quot; name=&quot;param1&quot; type=&quot;text&quot;&gt;&lt;/field&gt; 
  &lt;/fieldset&gt;&lt;/fields&gt;
&lt;/config&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/7877156087230255674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/08/create-new-module-on-joomla-17.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7877156087230255674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7877156087230255674'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/08/create-new-module-on-joomla-17.html' title='Create a new module on joomla 1.7'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-7502337281574334029</id><published>2011-07-17T03:45:00.000-07:00</published><updated>2011-07-17T03:45:37.997-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="spaghetti"/><title type='text'>spaghetti code</title><content type='html'>I am working these days enhancing an old project .&lt;br /&gt;
I am writing some tweaks in a php page , that prints html code , and sometimes javascript code , that is included from another php code , that reads a cached file and writes a js array and then prints html code .&lt;br /&gt;
&lt;br /&gt;
The legacy application connects to MsSql database , and for making a development virtual machine , we were obligated to run the application on windows xp , installing xampp and we started the game .&lt;br /&gt;
&lt;br /&gt;
Always the first level is easy , some minor enhancements were required , and we were done .&lt;br /&gt;
But the post levels were tricky , some pages were not working at all , I struggled to find the reason , and I was surprised when I found it .&lt;br /&gt;
&lt;br /&gt;
Some php pages where including some other pages , a way like this&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;include &quot;/var/www/lib/ClassName.php&quot; ;
&lt;/pre&gt;&lt;br /&gt;
Of course that was not working in Windows Xp , as there is now &quot;/var/www&quot; in windows platforms , so I learned a new lesson , when writing an application , the&amp;nbsp;safest way to include files is to make one file of configuration that holds all the root folders as constant variables .&lt;br /&gt;
And when including specific files , you use those variables , and change it whenever you want , for example if you change the environment .&lt;br /&gt;
&lt;br /&gt;
I love Linux .</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/7502337281574334029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/07/spaghetti-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7502337281574334029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/7502337281574334029'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/07/spaghetti-code.html' title='spaghetti code'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-3701405561038992290</id><published>2011-06-30T05:32:00.000-07:00</published><updated>2011-07-03T03:51:49.043-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="zend framework"/><title type='text'>Zend Framework modular design</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
This is a repost of the &lt;a href=&quot;http://www.phpandthecity.com/2010/11/zend-framework-modular-design.html&quot;&gt;old post&lt;/a&gt; about the zend framework modular redesign .&lt;br /&gt;
&lt;br /&gt;
Files and directories hierearchy&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;www/
 application/
  admin/
   controllers/
   forms/
   layouts/
   models/
   views/
  configs/
   application.ini
  default/
   controllers/
   forms/
   layouts/
   models/
   views/
  Bootrstap.php
 library/
  Zend/
 public/
  index.php
&lt;/pre&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
And here is the configs/application.ini file , I will list the most important lines .&lt;br /&gt;
This is for the modules , note that we have made the module directory , the Application Path itself , so you can put your modules inside application directory as we did in the directories hierarchy .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;includePaths.library = APPLICATION_PATH &quot;/../library&quot;

bootstrap.path = APPLICATION_PATH &quot;/Bootstrap.php&quot;
bootstrap.class = &quot;Bootstrap&quot;

appnamespace = &quot;Application&quot;
resources.frontController.moduleDirectory = APPLICATION_PATH 
resources.modules[] = 
&lt;/pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
and in the Bootstrap file , you can define _init function as you can , the most important one is the autoload function , here is Bootstrap.php file&lt;br /&gt;
here you are loading the two namespace you have ( default and admin ) .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    public function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader(
                        array(&#39;namespace&#39; =&gt; &#39;Default&#39;,
                            &#39;basePath&#39; =&gt; dirname(__FILE__) . &#39;/default&#39;,
                        )
        );
        
        $autoloader2 = new Zend_Application_Module_Autoloader(
                        array(&#39;namespace&#39; =&gt; &#39;Admin&#39;,
                            &#39;basePath&#39; =&gt; dirname(__FILE__) . &#39;/admin&#39;,
                        )
        );
        
        $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . &#39;/configs/application.ini&#39;);
        Zend_Layout::startMvc();
        $bootstrap = $application-&gt;getBootstrap();

        Zend_Session::start();
        $db = new Zend_Db_Adapter_Mysqli($bootstrap-&gt;getOption(&quot;database&quot;));
        Zend_Db_Table_Abstract::setDefaultAdapter($db);
        return $autoloader;
    }
}
&lt;/pre&gt;That&#39;s it , feel free to ask any questions .&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/3701405561038992290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/zend-framework-modular-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3701405561038992290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3701405561038992290'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/zend-framework-modular-design.html' title='Zend Framework modular design'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-4587532810400288913</id><published>2011-06-16T04:34:00.000-07:00</published><updated>2011-06-25T03:44:52.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bad superblock"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>BAD SUPERBLOCK</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I fixed a bad superblock on linux ubuntu 10.10&lt;br /&gt;
I did recover some important files , I will reinstall ubuntu 11.04 64bit .&lt;br /&gt;
&lt;br /&gt;
I took advice from this link&lt;br /&gt;
&lt;a href=&quot;http://www.cyberciti.biz/faq/recover-bad-superblock-from-corrupted-partition/&quot;&gt;http://www.cyberciti.biz/faq/recover-bad-superblock-from-corrupted-partition/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/4587532810400288913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/bad-superblock.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/4587532810400288913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/4587532810400288913'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/bad-superblock.html' title='BAD SUPERBLOCK'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-3373031751847331322</id><published>2011-06-09T08:03:00.000-07:00</published><updated>2011-06-09T08:03:16.722-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mobile"/><title type='text'>Blogger Buzz: Announcing Blogger Mobile Templates</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;a href=&quot;http://buzz.blogger.com/2011/06/announcing-blogger-mobile-templates.html?spref=bl&quot;&gt;Blogger Buzz: Announcing Blogger Mobile Templates&lt;/a&gt;: &quot;Posted by Jiho Han, Software Engineer   A few months ago we introduced mobile templates to Blogger in Draft . Today, we’re excited to announ...&quot;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;From Blogger Buzz&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This is very nice , I tried it for this blog and it seems good on iphone .&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/3373031751847331322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/blogger-buzz-announcing-blogger-mobile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3373031751847331322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3373031751847331322'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/blogger-buzz-announcing-blogger-mobile.html' title='Blogger Buzz: Announcing Blogger Mobile Templates'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-888175680513849332</id><published>2011-06-09T07:59:00.000-07:00</published><updated>2011-07-03T03:58:39.057-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>How to know first revisions on svn branches ?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;So , if you are working as builder who merge the branches to the trunks , and find conflicts and all that *** * , I think that command will help you .&lt;br /&gt;
&lt;br /&gt;
This will help you the first revision of the branch , so you can only merge the needed revisions&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;svn log BRANCH_LINK --stop-on-copy&lt;/pre&gt;The last revision will be the revision of copying .&lt;br /&gt;
Merging of course will be easy like this&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;svn merge -r REVISION:HEAD BRANCH_LINK&lt;/pre&gt;&lt;br /&gt;
Assuming that your current directory is the working copy .&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/888175680513849332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/how-to-know-first-revisions-on-svn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/888175680513849332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/888175680513849332'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/how-to-know-first-revisions-on-svn.html' title='How to know first revisions on svn branches ?'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-5987752610770225136</id><published>2011-06-07T04:20:00.000-07:00</published><updated>2011-07-03T04:00:18.195-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>How to know the changed files on your svn branch ?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Hi all&lt;br /&gt;
&lt;br /&gt;
Sometimes I encountered this problem with working with SVN , I took a branch and made a lot of changes , then I need to know which files I have changed in .&lt;br /&gt;
&lt;br /&gt;
This can be done with a simple svn command , execute it on your branch .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;svn diff -r 1234:HEAD --summarize&lt;/pre&gt;&lt;br /&gt;
Where 1234 is the revision of the branch when you first copied it .&lt;br /&gt;
That&#39;s it , this command will list all your changes .&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/5987752610770225136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/how-to-know-changed-files-on-your-svn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5987752610770225136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5987752610770225136'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/06/how-to-know-changed-files-on-your-svn.html' title='How to know the changed files on your svn branch ?'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-5533884401971619015</id><published>2011-04-18T10:43:00.000-07:00</published><updated>2011-07-03T04:01:31.093-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>How to install jre on Ubuntu 10.10</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Hi&lt;br /&gt;
&lt;br /&gt;
This is a problem that faced me on installing a new version of ubuntu 10.10 , I think a big number of ubuntu users have the same problem .&lt;br /&gt;
&lt;br /&gt;
How to install java ( jre and jdk ) on Ubuntu&lt;br /&gt;
&lt;br /&gt;
I followed the instructions on &lt;a href=&quot;http://www.ubuntugeek.com/how-to-install-java-runtime-environment-jre-in-ubuntu-10-10-maverick-using-ppa.html&quot;&gt;this page&lt;/a&gt; from ubuntugeek.com and it worked successfully .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin
&lt;/pre&gt;&lt;br /&gt;
I hope it will help anyone .&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/5533884401971619015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/04/how-to-install-jre-on-ubuntu-1010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5533884401971619015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/5533884401971619015'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/04/how-to-install-jre-on-ubuntu-1010.html' title='How to install jre on Ubuntu 10.10'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-3397546436307588812</id><published>2011-03-27T11:15:00.000-07:00</published><updated>2011-03-27T11:15:41.024-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="28jan"/><category scheme="http://www.blogger.com/atom/ns#" term="internet errors"/><title type='text'>Internet Errors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Here I am listing the errors I have found using Google Chrome on 28 January , when the internet was down in Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 118 (net::ERR_CONNECTION_TIMED_OUT): The operation timed out.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 101 (net::ERR_CONNECTION_RESET): Unknown error.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 105 (net::ERR_NAME_NOT_RESOLVED): The server could not be found.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 7 (net::ERR_TIMED_OUT): The operation timed out.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 109 (net::ERR_ADDRESS_UNREACHABLE): Unable to reach the server.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error Code 1460: timeout&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;504 Gateway Time-out&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Oooooh these days , I hope they will never come again ......&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/3397546436307588812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2011/03/internet-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3397546436307588812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/3397546436307588812'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2011/03/internet-errors.html' title='Internet Errors'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-8690941500587355910</id><published>2010-11-28T05:27:00.000-08:00</published><updated>2011-07-10T15:24:54.885-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="modules"/><category scheme="http://www.blogger.com/atom/ns#" term="zend framework"/><title type='text'>Zend Framework Modular Design</title><content type='html'>&lt;b&gt;This is an old post , please refer to the new one &lt;a href=&quot;http://www.phpandthecity.com/2011/06/zend-framework-modular-design.html&quot;&gt;here&lt;/a&gt; .&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
In this tutorial , I will show you how to make a module based web application using zend framework .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Application Structure&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is the default application structure for a zend framework web application .&lt;br /&gt;
The simple change you can see is modules directory inside application directory , which will contain the different modules of your application&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- application&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- configs&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- controllers&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- modules&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- views&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- Bootstrap.php&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- library&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- public&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Module Structure&lt;/b&gt;&lt;br /&gt;
Inside modules directory you will put a directory for each module you will make .&lt;br /&gt;
I will make an admin module so my modules directory will be like the following .&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- configs&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- controllers&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- modules&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;- admin&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- views&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;- Bootstrap.php&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;configs/application.ini&lt;/b&gt;&lt;br /&gt;
Here is the configuration you should put to enable modules structure in your zend framework application.&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;resources.frontController.controllerDirectory = APPLICATION_PATH &quot;/controllers&quot;&lt;br /&gt;
resources.frontController.moduleDirectory = APPLICATION_PATH &quot;/modules&quot;&lt;br /&gt;
resources.modules[] = &lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Bootstrap.php&lt;/b&gt;&lt;br /&gt;
And this is the main Bootstrap file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;protected function _initAppAutoload() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$autoloader = new Zend_Application_Module_Autoloader(array(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;namespace&#39; =&amp;gt; &#39;Default&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;basePath&#39; =&amp;gt; dirname(__FILE__),&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $autoloader;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
}&lt;/div&gt;&lt;b&gt;Module Bootstrap.php&lt;/b&gt;&lt;br /&gt;
And this is bootstap file of the admin module&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;Pay attention that this class extends Zend_Application_Module_Bootstrap file not Zend_Application_Bootstrap_Bootstrap like the main bootstrap file .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Module Controller&lt;/b&gt;&lt;br /&gt;
This is an example of controller in the module&lt;br /&gt;
/application/modules/admin/controllers/IndexController.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;&lt;br /&gt;
class Admin_IndexController extends Zend_Controller_Action {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;public function init() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Initialize action controller here */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;public function indexAction() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/8690941500587355910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/zend-framework-modular-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8690941500587355910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/8690941500587355910'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/zend-framework-modular-design.html' title='Zend Framework Modular Design'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-498877059665891053</id><published>2010-11-24T09:52:00.000-08:00</published><updated>2010-11-24T09:52:14.606-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="ipod"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Add files and songs to iPhone from Linux</title><content type='html'>Far from php , here is a good way to sync your songs and files from PC to iphone , it works also with ipod .&lt;br /&gt;
&lt;br /&gt;
Open terminal and run the following&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;&lt;br /&gt;
sudo apt-get install gtkpod&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
For more info you can visit &lt;a href=&quot;http://www.gtkpod.org/wiki/Home&quot;&gt;Gtkpod home page&lt;/a&gt; .</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/498877059665891053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/add-files-and-songs-to-iphone-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/498877059665891053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/498877059665891053'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/add-files-and-songs-to-iphone-from.html' title='Add files and songs to iPhone from Linux'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-6436710873925830096</id><published>2010-11-21T04:22:00.000-08:00</published><updated>2012-11-08T04:28:13.755-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="library"/><category scheme="http://www.blogger.com/atom/ns#" term="zend framework"/><title type='text'>Add new library in Zend Framework</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In case you have your own library , and you want to use beside the Zend Framework library , all you have to do is to place your library directory beside Zend library as the following&amp;nbsp;hierarchy&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&lt;br /&gt;
application&lt;br /&gt;
library&lt;br /&gt;
---- Zend&lt;br /&gt;
---- Php&lt;br /&gt;
public&lt;/pre&gt;
&lt;br /&gt;
Then in /application/configs/application.ini you should add the following line&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
autoloaderNamespaces.php = &quot;Php_&quot;&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
Of course you should name your classes as Zend convention , to load them easily .&lt;br /&gt;
For example if you have a class named Php_Class_Test , so its path will be Php/Class/Test.php&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/6436710873925830096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/add-new-library-in-zend-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6436710873925830096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/6436710873925830096'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2010/11/add-new-library-in-zend-framework.html' title='Add new library in Zend Framework'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5431265932220094605.post-2302129445138022518</id><published>2010-10-31T12:33:00.000-07:00</published><updated>2011-07-04T03:30:20.001-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="stripos"/><category scheme="http://www.blogger.com/atom/ns#" term="strpos"/><title type='text'>Why strpos don&#39;t work ???</title><content type='html'>Hi Guys&lt;br /&gt;
&lt;br /&gt;
I encountered a problem when using strpos .&lt;br /&gt;
&lt;br /&gt;
Here is the code&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php
if(strpos(&quot;test&quot;,&quot;t&quot;)
echo &quot;found&quot;;
else
echo &quot;not found&quot;;

?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
That code outputs &quot; not found &quot;.&lt;br /&gt;
The problem is strpos returns the first position of the needle ( &quot;t&quot; ) in the haystack ( &quot;test&quot; ) you are searching in , and in our example , the first position is 0 , which is being casted to boolean , and so it&#39;s false .&lt;br /&gt;
&lt;br /&gt;
So the best practice of using strpos and stripos is to use === ( equal in type and value ) like the following example .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php
$pos = strpos(&quot;test&quot;,&quot;t&quot;);

if($pos === false )
&amp;nbsp;&amp;nbsp;echo &quot;not found&quot;;
else
&amp;nbsp;&amp;nbsp;echo &quot;found&quot;;
?&amp;gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpandthecity.blogspot.com/feeds/2302129445138022518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://phpandthecity.blogspot.com/2010/10/why-strpos-dont-work.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/2302129445138022518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5431265932220094605/posts/default/2302129445138022518'/><link rel='alternate' type='text/html' href='http://phpandthecity.blogspot.com/2010/10/why-strpos-dont-work.html' title='Why strpos don&#39;t work ???'/><author><name>Adham</name><uri>http://www.blogger.com/profile/15699403808335198791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>