<?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: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-9188371100743875536</id><updated>2011-12-24T00:26:47.449-08:00</updated><category term='apache'/><category term='linux'/><category term='startup script'/><category term='shell script'/><category term='installation'/><category term='javascript'/><category term='documentation'/><category term='client'/><category term='Debian'/><category term='php'/><category term='ajax'/><category term='perl'/><category term='reboot'/><category term='freetds'/><category term='jsdoc'/><category term='file uploads'/><category term='long list of web directories seo search engine optimization'/><category term='tricks and tips'/><category term='dojo'/><category term='commands'/><category term='helpful'/><category term='ms sql server'/><category term='unix'/><category term='html'/><category term='script'/><category term='windows'/><category term='one liners'/><category term='ubuntu'/><category term='little'/><category term='Debian installation hardening Debian 3.1r0a'/><category term='installing atmail webmail client mac os x server using apache and mysql'/><category term='notes'/><title type='text'>Shahryar Ghazi's Blog</title><subtitle type='html'>A blog about Linux, Windows, Programming, Server Administration</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-7838223079199926266</id><published>2007-01-26T08:36:00.000-08:00</published><updated>2007-06-19T09:48:52.949-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='jsdoc'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Installing &amp; Configuring JSDoc On Windows</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;a href="http://technorati.com/faves?sub=addfavbtn&amp;amp;add=http://sghazi.blogspot.com"&gt;&lt;img src="http://static.technorati.com/pix/fave/btn-fave2.png" alt="Add to Technorati Favorites" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;This short tutorial will teach you how to install JSDoc on Windows.&lt;br /&gt;&lt;br /&gt;JSDOC is a Javascript documentation generator tool. You add formatted comments inside your javascript code, JSDOC takes all the commented javascript code as input and generates javadoc style documentation using those comments. For more details on how to use JSDOC visit http://jsdoc.sourceforge.net/.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;DISCLAIMER:&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Lets do the installation and configuration step-by-step&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JSDoc is a perl script, so in order to execute JSDoc you have to install a perl interpreter. JSDoc documentation recommends ActivePerl for Windows users.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Download the latest version of ActivePerl from http://www.activestate.com. Install ActivePerl on your windows machine.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Download JSDoc from http://sourceforge.net/projects/jsdoc.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Extract the downloaded zip file (above) in any folder.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Now, in order to run JSDoc using ActivePerl you have to install HTML-Template package for ActivePerl.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Assuming that you installed ActivePerl in c:\perl, go to c:\perl\bin and execute the command ‘ppm’.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ppm is a package manager for ActivePerl. The command ‘ppm’ will open up a window showing you a list of all available packages. Give it sometime to download data from the Internet.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Click on the button that reads “View All Packages” from the leftmost corner of the toolbar (or type Ctrl + 1 together).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;You’ll see a complete list of all packages. Scroll down to find HTML-Template. Once you find this package right click on it and click on install. This package will be marked for installation.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Now, you have to install the package that you just marked. Click on the button that reads “Run marked actions” (green colored arrow pointing towards right) or type Ctrl + Enter together.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;You’re done. ActivePerl is setup properly to run JSDoc.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Now, assuming that you’re inside the ActivePerl bin (c:\perl\bin) folder and you had extracted jsdoc zip file in f:\jsdoc you’ll run the command below to generate the documentation for a test javascript script file that comes with JSDoc.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;                         &lt;span style="color: rgb(102, 102, 102);"&gt; perl f:\jsdoc\jsdoc.pl F:\jsdoc\test.js&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Thats it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Documentation will be created inside the bin folder of ActivePerl in a folder named js_docs_out (JSDoc creates the output in js_docs_out folder in the folder where you run the jsdoc script from).&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-7838223079199926266?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/7838223079199926266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=7838223079199926266' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/7838223079199926266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/7838223079199926266'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2007/01/installing-configuring-jsdoc-on-windows.html' title='Installing &amp; Configuring JSDoc On Windows'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-3687793678474469301</id><published>2007-01-08T06:44:00.000-08:00</published><updated>2007-06-19T09:52:44.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startup script'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='reboot'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='shell script'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Starting Apache Web Server at every Reboot (for Ubuntu / Debian Linux)</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;If you compiled and installed Apache on a Debian/Ubuntu Linux machine and want the Apache service run every time you reboot your machine this short tutorial is for you. I have tried to make it very simple so I am pretty sure you'll be able to follow all steps even if you don't know Unix/Linux shell scripting.&lt;br /&gt;&lt;br /&gt;Before we proceed please read the disclaimer below.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DISCLAIMER:&lt;/span&gt; I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In order to run Apache at boot time you have to write a very simple start up script. Follow the steps below. Please note that you ave to run the commands as root for both Ubuntu and Debian.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;In Ubuntu, do the following (you'll probably be prompted for password).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;            &lt;span style="color: rgb(102, 102, 102);"&gt;sudo nano /etc/init.d/apache2&lt;/span&gt;&lt;br /&gt;      In Debian do the following (as root).&lt;br /&gt;          &lt;span style="color: rgb(102, 102, 102);"&gt;nano /etc/init.d/apache2&lt;/span&gt;&lt;br /&gt;      The above command will open up a text editor with an empty page (assuming that /etc/init.d/apache2 did not previously exist or was empty).&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Now, enter the code below in your text editor. Lines starting with a # symbol are comments (except the first line).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 102, 102);"&gt;        #!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;        case "$1" in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;        start)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;        echo "Starting Apache ..."&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;       # Change the location to your specific location&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;       /usr/local/apache2/bin/apachectl start&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;       ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;       stop)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;       echo "Stopping Apache ..."&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      # Change the location to your specific location&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      /usr/local/apache2/bin/apachectl stop&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      graceful)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      echo "Restarting Apache gracefully..."&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      # Change the location to your specific location&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      /usr/local/apache2/bin/apachectl graceful&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     restart)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     echo "Restarting Apache ..."&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;      # Change the location to your specific location&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     /usr/local/apache2/bin/apachectl restart&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     *)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     echo "Usage: '$0' {start|stop|restart|graceful}" &gt;&amp;2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     exit 64&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     esac&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     exit 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Now, press “Ctrl– o” to save the file and “Ctrl – x” to exit from the editor.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;You have to change the file permissions by executing the command below:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;        Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo chmod u+x /etc/init.d/apache2&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;chmod u+x /etc/init.d/apache2&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;To start Apache, run command below:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;        Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo /etc/init.d/apache2 start&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;/etc/init.d/apache2 start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      To stop Apache, run command below:&lt;br /&gt;      Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo /etc/init.d/apache2 stop&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;/etc/init.d/apache2 stop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      To restart Apache, run command below:&lt;br /&gt;      Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo /etc/init.d/apache2 restart&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;/etc/init.d/apache2 restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      To restart Apache gracefully, run command below:&lt;br /&gt;      Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo /etc/init.d/apache2 graceful&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;/etc/init.d/apache2 graceful&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;In order to add the script to the default runlevel you do the following.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;        Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo update-rc.d apache2 defaults&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;update-rc.d apache2 defaults&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;        In case you want to remove it from the run level you do the following.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;        Ubuntu: &lt;span style="color: rgb(102, 102, 102);"&gt;sudo update-rc.d –f apache2 remove&lt;/span&gt;&lt;br /&gt;      Debian: &lt;span style="color: rgb(102, 102, 102);"&gt;update-rc.d –f apache2 remove&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That’s it you’re done. Now, Apache will start automatically at boot time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-3687793678474469301?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/3687793678474469301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=3687793678474469301' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3687793678474469301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3687793678474469301'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2007/01/starting-apache-web-server-at-every.html' title='Starting Apache Web Server at every Reboot (for Ubuntu / Debian Linux)'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-901965281124244535</id><published>2006-12-22T18:59:00.000-08:00</published><updated>2007-06-19T09:52:29.873-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freetds'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='ms sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='client'/><title type='text'>Installing MS SQL Server Client Library on Linux/Unix</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Problem:&lt;/span&gt; Installing SQL Server client library on Debian/Ubuntu Linux.&lt;br /&gt;&lt;br /&gt;If you want to install PHP on a Linux machine and want to use Sql Server as your database then you have to install FreeTDS library on your server machine so that you could make your PHP/Apache server machine talk to your SQL Server 2000 Database. Let's go through the installation steps. Before we proceed please read the disclaimer below.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DISCLAIMER:&lt;/span&gt; I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).&lt;br /&gt;&lt;br /&gt;I have used the instructions on Debian/Ubuntu server machines. Make sure you have GNU compilation tools and libraries.&lt;br /&gt;&lt;br /&gt;In Debian/Ubuntu, try the following:&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;gcc -v&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;make -v&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;If you see the version numbers of the above two software that means gcc and make are installed on your computer. If you dont have these software installed then you have to first install them.&lt;br /&gt;&lt;br /&gt;In Ubuntu, do the following&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;sudo apt-get install build-essential&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;This will install the necessary software on your computer. I'd recommend using wget FTP client to download the software on Linux/Unix machines.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;The above command will download the software. Now, unzip and untar the downloaded gzipped tar file by executing the command below.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;tar –xvzf freetds-stable.tgz&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;Enter the folder where you untarred the downloaded file.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;cd freetds-stable&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;Configure and compile the software as follows (make sure you execute 'make install' command below as root):&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;./configure --prefix=/usr/local/freetds -- enable-msdblib&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;make&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;# make install&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;cd ..&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;&lt;span style="color:#000000;"&gt;FreeTDS has been installed in the folder /usr/local/freetds. &lt;/span&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;&lt;span style="color:#000000;"&gt;Now, if you want to install PHP then you have to configure PHP (while installing) using the switch as follows: &lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(102,102,102)"&gt;--with-mssql=/usr/local/freetds&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;I hope this will be a greate help for you. Please let me know if you want me to write on something else.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-901965281124244535?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/901965281124244535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=901965281124244535' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/901965281124244535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/901965281124244535'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/installing-ms-sql-server-client.html' title='Installing MS SQL Server Client Library on Linux/Unix'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-6798477009380322195</id><published>2006-12-18T09:06:00.000-08:00</published><updated>2007-06-19T09:52:13.874-07:00</updated><title type='text'>Simple Coding Style for PHP</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;Many programmers use different kinds of coding styles to write code I have my own version that (i think) is simple and easy-to-use. Before we proceed, please read the disclaimer below.&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DISCLAIMER:&lt;/span&gt; I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Code Formatting and Layout:&lt;/span&gt;&lt;br /&gt;Code Formatting and Layout – which includes indentation, line length, use of white space, and use of Structured Query Language (SQL).&lt;br /&gt;&lt;br /&gt;Use Soft Tabs (soft tabs are not actually tabs each soft tab is represented by a certain number of regular spaces) instead of Hard Tabs (regular tab).  The reason is that tab spacing is different for different editors. Tab width of five spaces is good.&lt;br /&gt;Try to break up lines after every 80 characters because 80 characters is the standard width of a Unix terminal and is a reasonable width for printing to hard copy in a readable font.&lt;br /&gt;&lt;br /&gt;Some examples:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;if ($month == ‘september’ || $month == ‘april’ || $month == ‘june’ ||&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     $month  == ‘november’) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;        return 30;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This should be changed to following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;if ($month == ‘september’ || &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    $month == ‘april’ || &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    $month == ‘june’ ||&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    $month == ‘november’)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    return 30;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This method works equally well for functions’ parameters:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;mail(email@companyname.com,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     “subject”,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     $body,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;     “from: &lt;someone@companyname2.com&gt;&lt;email@companyname.com&gt;\r\n”);&lt;/email@companyname.com&gt;&lt;/someone@companyname2.com&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Guidelines:&lt;/span&gt;&lt;br /&gt;We’ll follow the following rules:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Capitalize keywords&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Break lines on keywords&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Use table aliases to keep the code clean&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Example:&lt;/span&gt;&lt;br /&gt;Consider the following query:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$query  =    “select firstname, lastname from employees,&lt;br /&gt;departments where employees.dept_id = department.dept_id&lt;br /&gt;and department.name = ‘Arts’”;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Above should be changed to following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;br /&gt;$query  =  “SELECT    firstname, lastname&lt;br /&gt;       FROM      employees e, departments d&lt;br /&gt;       WHERE     e.dept_id = d.dept_id&lt;br /&gt;       AND       d.name = ‘Arts’”;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Using braces in control structures (e.g. if, for, foreach, while):&lt;/span&gt;&lt;br /&gt;To avoid confusion, we’ll always use braces, even when only a single statement is being conditionally executed.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;if( isset ($name))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    echo “hello $name”;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Must be changed to following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;if( isset ($name))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;   echo “hello $name”;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Consistency in using braces:&lt;/span&gt;&lt;br /&gt;We’ll use BSD style braces for conditional statements. In BSD style braces the braces are placed on the line following the conditional with the braces outdented to align with the keyword.  Follow the same rule for functions.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;if ($conditional)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    //statement&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some more guidelines:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;“foreach” is better than “for” which is better than “while”.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Never use nonsense names for variables e.g. foo, sz, var and etc.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Try not to use global variables but if for some reason use them then all global variables and constants will be represented by capital letters e.g. $CACHE_PATH, $FILE_NAME and etc.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Try making classes where possible.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Long-lived variable (not necessarily a global, or even in the main scope; it is simply a variable that is used through any significant length of code and/or whose representation can use clarification) should have concise but descriptive names.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Temporary variables should be short and concise. Numeric variables used for iteration should always be named i,j,k,l,m, and n.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;We’re not going to use tags like the following  . We’ll be using  or &amp;lt;script language="”php”"&amp;gt; &amp;lt;/script&amp;gt; (work in Front Page too).&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Use echo not print.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;We’ll be using C and C++ style comments i.e. “//” and “/* */”. We won’t use “#”.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Comments like the following are useless so avoid using them.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 102, 102);"&gt;// Increment i&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$i++;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Using phpdoc for documentation.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;For multiword names for variables, use underscores to break words.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$num_elements = count($elements);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Function Names: They should be all lowercase, and multiword names should be separated by underscores. e.g.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;function print_hello($name)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;echo “Hello $name”;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Class Names:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;The first letter of a class name is capitalized. This visually distinguishes a class name from a member name.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Underscore should be used to simulate nested namespaces.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Multiword class names should be concatenated, and the first letter of each word should be capitalized. e.g.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 102, 102);"&gt;class XML_RSS {}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;class Text_PrettyPrinter {}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Method Names:&lt;/span&gt;&lt;br /&gt;The Java style is to concatenate words in multiword method names and uppercase the first letter of every word after the first. e.g.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;class XML_RSS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    function startHandler() {}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Naming Consistency:&lt;/span&gt;&lt;br /&gt;Variables that are used for similar purposes should have similar names. e.g.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$max_element;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$min_element;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$sum_element;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$prev_item;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$curr_item;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$next_item;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Matching Variable Names to Schema Names:&lt;/span&gt;&lt;br /&gt;Variable names that are associated with database records should always have matching names.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$query   = “SELECT  firstname, lastname, employee_id &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;            FROM    employees”;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;$results =  mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;while(list($firstname, $lastname, $employee_id) = mysql_fetch_row())&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;    //….&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Documentation:&lt;/span&gt;&lt;br /&gt;We’ll use phpDocumentor to generate documentation on the fly. Please take a look at the software www.phpdoc.org.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-6798477009380322195?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/6798477009380322195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=6798477009380322195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/6798477009380322195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/6798477009380322195'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/simple-coding-style-for-php.html' title='Simple Coding Style for PHP'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-8699208521159768016</id><published>2006-12-13T06:36:00.000-08:00</published><updated>2007-06-21T10:17:42.432-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='file uploads'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='dojo'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>AJAX File Uploads (using Dojo and PHP)</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;It is easy to upload files using Ajax and PHP. How? I'll try to explain below.&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;We'll be using some common sense, Dojo Framework for AJAX, HTML, Apache, Javascript, and PHP. Make sure you install Apache and PHP (read other tutorials for that). I'll explain how to setup Dojo (for this tutorial) below. But before we proceed please read and understand the disclaimer below.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;DISCLAIMER:&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Make sure you configure PHP to allow file uploads.&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li  style="color: rgb(0, 0, 0);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Fire up your browser and go to http://dojotoolkit.org/. Download Dojo form the website. I've used version 0.4.1 for this tutorial.&lt;/span&gt;&lt;/li&gt;&lt;li  style="color: rgb(0, 0, 0);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;After downloading the zip file go to the folder where you want to put your file upload code (I've named this file index.php). Unzip the downloaded file in that folder and rename the new folder created (e.g. dojo-0.4.1-ajax.zip) to dojo.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;Enter the code below in the head (between &amp;lt;head&amp;gt; and &amp;lt;/head&amp;gt;) section of your HTML file (that contains file upload form). I'm naming it index.php.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;          &lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;" &gt;  &lt;span style=";font-family:arial;font-size:85%;"  &gt;&amp;lt;script language="javascript" type="text/javascript" src="./dojo/dojo.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; Now in the body of the index.php enter the form as follows.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;" &gt;            &lt;span style="font-size:85%;"&gt;&amp;lt;form id="upload_file" action="file_upload_script.php" method="post"  &lt;br /&gt;                     enctype="multipart/form-data"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;                &amp;lt;input type="hidden" name="MAX_FILE_SIZE" value="8388608" /&amp;gt;&lt;br /&gt;           &amp;lt;input type="file" name="select_file" tabindex="1" size="35" /&amp;gt;&lt;br /&gt;           &amp;lt;input type="button" value="Submit" onClick="upload_file_submit()" tabindex="2"&amp;gt;&lt;br /&gt;           &amp;lt;/form&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="color: rgb(0, 0, 0);font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;       For the sake of simplicity I am using a very simple form. You can add more fields if you want.&lt;/span&gt;&lt;/p&gt;&lt;ul  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Now, enter the javascript code below in your head section of index.php.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;       &amp;lt;!--&lt;br /&gt;       // Dojo configuration and Variable Initialization&lt;br /&gt;       // Put this code in index.php before the line where you include the javascript for dojo&lt;br /&gt;       // djConfig = { isDebug: true };&lt;br /&gt;       dojo.require("dojo.io.*");&lt;br /&gt;       dojo.require("dojo.io.IframeIO");&lt;br /&gt;       ctr = 0;&lt;br /&gt;       function upload_file_submit()&lt;br /&gt;       {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;            var bindArgs = {&lt;br /&gt;&lt;/span&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;                formNode:  document.getElementById("upload_file"), // form's id&lt;br /&gt;           mimetype:  "text/plain",  // Enter file type info here&lt;br /&gt;           content:&lt;br /&gt;           {&lt;br /&gt;               increment: ctr++,&lt;br /&gt;               name:  "select_file",  // file name in the form&lt;br /&gt;               post_field: ""    // add more fields here .. fields will be accessible through $_POST["psot_fields"]&lt;br /&gt;       },&lt;br /&gt;       handler: function(type, data, evt)&lt;br /&gt;       {&lt;br /&gt;           // handle successful response here&lt;br /&gt;           if(type == "error")  alert("Error occurred. ");&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;           // getting error message from PHP's file upload script&lt;br /&gt;           res  =  dojo.byId("dojoIoIframe").contentWindow.document.getElementById("output").innerHTML;&lt;br /&gt;           //  Incase of an error, display the error message&lt;br /&gt;           if(res != "true")  alert(res);&lt;br /&gt;           else    alert("File uploaded successfully.");&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;   };&lt;br /&gt;   var request = dojo.io.bind(bindArgs);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   //--&amp;gt;&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;ul  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Now, create a file named file_upload_script.php and add the code below in that file.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;             &lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;&amp;lt;script language="php"&amp;gt;&lt;br /&gt;     // You can send any message to javascript client using die(create_message(&amp;lt;message&amp;gt;)); ...&lt;br /&gt;     //this function will terminate the script and will return control to the client&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;          if( isset($_POST["MAX_FILE_SIZE"]) &amp;&amp;amp; isset($_FILES))&lt;br /&gt;&lt;/span&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;            {&lt;br /&gt;       if( $_FILES['select_file']['size'] &amp;gt; $_POST["MAX_FILE_SIZE"])&lt;br /&gt;           die(create_message("File size must be less than ".$_POST["MAX_FILE_SIZE"]." bytes."));&lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;          $uploadFile   = "./file_name_on_server.txt";&lt;br /&gt;&lt;/span&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;            if(move_uploaded_file( $_FILES['select_file']['tmp_name'], $uploadFile))&lt;br /&gt;       {&lt;br /&gt;           $fp   = fopen ($uploadFile, "rb");&lt;br /&gt;           if(!$fp)  die(create_message("Error opening uploaded file."));&lt;br /&gt;           fclose($fp);&lt;br /&gt;           // SENDING TRUE IS MANDATORY SO THAT THE JAVASCRIPT&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;                //FUNCTION KNOWS THAT THE FILE HAS BEEN UPLOADED PROPERLY&lt;br /&gt;           die(create_message("true"));&lt;br /&gt;       }&lt;br /&gt;       else die(create_message( $_FILES['select_file']['tmp_name']." could not be uploaded successfully."));&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   else  die(create_message( "Error in form input: Data is missing. "));&lt;/span&gt;&lt;/p&gt;&lt;p  style="color: rgb(102, 102, 102);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;      function create_message($string)&lt;br /&gt;&lt;/span&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:85%;"  &gt;        {&lt;br /&gt;   $output = "";&lt;br /&gt;   $output .= "&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;";&lt;br /&gt;   $output .= "&amp;lt;textarea id=\"output\"&amp;gt;";&lt;br /&gt;   $output .= trim($string);&lt;br /&gt;   $output .= "&amp;lt;/textarea&amp;gt;";&lt;br /&gt;   $output .= "&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;";&lt;br /&gt;   return $output;&lt;br /&gt;   }&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;That's it. Go to index.php from your browser and upload a text file. Press submit. If there is no error you should see File uploaded successfully message.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-8699208521159768016?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/8699208521159768016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=8699208521159768016' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/8699208521159768016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/8699208521159768016'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/file-uploads-in-ajax-using-dojo-and-php.html' title='AJAX File Uploads (using Dojo and PHP)'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-582445252394773894</id><published>2006-12-11T10:41:00.000-08:00</published><updated>2007-07-06T05:59:01.584-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='installing atmail webmail client mac os x server using apache and mysql'/><title type='text'>Installing Atmail Webmail Client on Mac OS X</title><content type='html'>Because of a very good response from readers I have created my own website. &lt;br /&gt;"Installing Atmail Webmail Client on Mac OS X" can now be found &lt;a href="http://www.techsww.com/tutorials/webmail/atmail/installation/installing_atmail_webmail_client_on_mac_osx.php"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-582445252394773894?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/582445252394773894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=582445252394773894' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/582445252394773894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/582445252394773894'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/installing-atmail-webmail-client-on-mac.html' title='Installing Atmail Webmail Client on Mac OS X'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-2128319659802047736</id><published>2006-12-10T17:16:00.000-08:00</published><updated>2007-06-19T09:51:38.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='notes'/><category scheme='http://www.blogger.com/atom/ns#' term='one liners'/><category scheme='http://www.blogger.com/atom/ns#' term='tricks and tips'/><category scheme='http://www.blogger.com/atom/ns#' term='helpful'/><category scheme='http://www.blogger.com/atom/ns#' term='little'/><category scheme='http://www.blogger.com/atom/ns#' term='commands'/><title type='text'>General Tips &amp; Tricks</title><content type='html'>&lt;p&gt;&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;div  style="text-align: center;font-family:verdana;"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tips &amp; Tricks&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://del.icio.us/feeds/js/networkbadge/shahryarghazi?name;icon"&gt;&lt;/script&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Disclaimer:&lt;/span&gt;&lt;span style="font-size:85%;"&gt; I (the author of this blog) wants to let you know that you'll use any or all of the instructions on this page at your own risk and I am not responsible for any kind of damage caused (indirectly or directly or in any other way) by following the instructions below or by reading the article and/or my blog.&lt;br /&gt;&lt;br /&gt;Here is a list of tips and tricks that I found useul. This list is my on-going work so expect it to change very often and keep visiting.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#first" alt="How to create a one-to-one relationship in MS Sql Server 2000 Enterprise Manager Diagram Editor" title="How to create a one-to-one relationship in MS Sql Server 2000 Enterprise Manager Diagram Editor"&gt;How to create a one-to-one relationship in MS Sql Server 2000 Enterprise Manager Diagram Editor&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#second" alt="Cloak / Uncloak SCM (subversion) directories in Dreamweaver" title="Cloak / Uncloak SCM (subversion) directories in Dreamweaver"&gt;Cloak / Uncloak SCM (subversion) directories in Dreamweaver&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#third" alt="Go to Top of Page Using Javascript" title="Go to Top of Page Using Javascript"&gt;Go to Top of Page Using Javascript&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#fourth" alt="Javascript: Execute a function every second" title="Javascript: Execute a function every second"&gt;Javascript: Execute a function every second&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#fifth" alt="MS SQL SERVER 2000: Comparing DATETIME Value and Date String" title="MS SQL SERVER 2000: Comparing DATETIME Value and Date String"&gt;MS SQL SERVER 2000: Comparing DATETIME Value and Date String&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#sixth" alt="Javascript:Sleep, Wait, Pause, Stop, Halt Execution for 2 Seconds" title="Javascript: Sleep Wait Pause Stop for 2 Seconds"&gt;Javascript: Sleep for 2 Seconds&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://sghazi.blogspot.com/2006/12/tips-tricks.html#seventh" alt="PHP:Finding name of caller function" title="PHP: Finding name of caller function"&gt;PHP: Finding name of caller function&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="first"&gt;How to create a one-to-one relationship in MS Sql Server 2000 Enterprise Manager Diagram Editor:&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Make the column unique in the table where the key is acting as foreign key.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="second"&gt;Cloak / Uncloak SCM (subversion) directories in Dreamweaver&lt;/a&gt;&lt;/span&gt;&lt;a name="second"&gt;&lt;br /&gt;Its very easy to do that. You just have to go to "&lt;/a&gt;&lt;a href="http://www.adobe.com/cfusion/exchange/index.cfm" target="__blank"&gt;Adobe Exchange&lt;/a&gt;" and search for the string "svn cloak uncloak". It'll show you only one result. Go to the result page and download the dreamweaver extension. Now, fire up your Dreamweaver (I tried version 8), click on Command-&gt;Manage Extensions. This will open up a tiny window on your screen. Click on the toolbar button "Install Extension" and select the file you downloaded from Adobe Exchange. This will install the extension. After installation is complete you'll see two new menu items under Command Menu item (i) Clock SCM Directories (ii) Uncloak SCM directories. Names are self-explanatory, so wont tell you what to do next.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="third"&gt;&lt;/a&gt;Go to Top of the Page Using Javascript&lt;/span&gt;&lt;br /&gt;Use the code below&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;window.scrollTo(0,0);&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="fourth"&gt;&lt;/a&gt;Javascript: Execute a function every second&lt;/span&gt;&lt;br /&gt;Use the Code below to do that&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;var timer = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;timer = setInterval('function()', 1000); // time = 1000 ms&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;a name="fifth"&gt;&lt;/a&gt;MS SQL SERVER 2000: Comparing DATETIME Value and Date String:&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;In order to compare a DateTime column with a Date string you have to use the string below in SQL's Where clause.&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;WHERE CONVERT(VARCHAR, [birth_date], 1) = '12/27/81'&lt;/span&gt;&lt;br /&gt;where birth_date is a DateTime column in the table.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="sixth"&gt;&lt;/a&gt;Javascript: Sleep for 2 Seconds&lt;/span&gt;&lt;br /&gt;Use the function below to do that. Pass 2000 to this function to sleep for 2 seconds.&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;function js_sleep(milliseconds){&lt;br /&gt;var date = new Date();&lt;br /&gt;var curDate = null;&lt;br /&gt;do{ curDate = new Date(); }while(curDate - date &amp;lt; milliseconds);&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="seventh"&gt;&lt;/a&gt;PHP: Finding name of caller&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;function called_function()&lt;br /&gt;{&lt;br /&gt;$backtrace = debug_backtrace();&lt;br /&gt;print "Caller is:".$backtrace[1]['function'];&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;span style="font-size:130%;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;Please let me know if you have some tips and tricks that I can add here.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;NOTE: See readers' comments after the advertisement.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-2128319659802047736?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/2128319659802047736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=2128319659802047736' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/2128319659802047736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/2128319659802047736'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/tips-tricks.html' title='General Tips &amp; Tricks'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-3170459620698691958</id><published>2006-12-10T07:29:00.000-08:00</published><updated>2007-07-06T05:56:04.910-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debian installation hardening Debian 3.1r0a'/><title type='text'>Debian Installation and Hardening</title><content type='html'>Because of a very good response from readers I have created my own website. "Debian installation and hardening" can now be found &lt;a href="http://www.techsww.com/tutorials/operating_systems/linux/configuration/debian_installation_and_hardening.php"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-3170459620698691958?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/3170459620698691958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=3170459620698691958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3170459620698691958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3170459620698691958'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/debian-installation.html' title='Debian Installation and Hardening'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9188371100743875536.post-3909294507355031853</id><published>2006-12-10T07:06:00.000-08:00</published><updated>2007-06-19T09:51:14.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='long list of web directories seo search engine optimization'/><title type='text'>SEO - A Long List of Free Web Directories</title><content type='html'>&lt;a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"&gt; &lt;img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cliky.com"&gt;Cliky Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.diggeek.com/"&gt;DigGeek web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.weareyourfriends.se"&gt;WeAreYourFriends.se Svenska Länkar&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flexengine.com" id="R8346E7"&gt;Flexengine Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.freekicktemple.com/"&gt;Freekick Temple&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blackdhalia.com"&gt;Black Dhalia Internet Directory&lt;/a&gt;&lt;br /&gt;all2time directory &lt;a href="http://directory.all2time.com/"&gt;http://directory.all2time.com/&lt;/a&gt; Free web directory. All only for you. Submit your site and increase your google page rank.&lt;br /&gt;&lt;a href="http://webresources.akipus.com/"&gt;Internet Webresources&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.urlchief.com/"&gt;URL Chief Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.topdot.org/"&gt;Top Dot Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://taterlinks.com/"&gt;Tater Links : Darkside SEO Links&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.samsdirectory.com/"&gt;Sams Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://referralandrecommendation.com/linkdirectory/"&gt;Add Your URL&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.matrixsolutnz.net" id="RC5D3B5"&gt;Matrixsolutnz.net&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.maxxfusion.com/"&gt;Affordable Shopping Cart Software and Network Management Systems by Maxxfusion – Website design - hosting - maintenance&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linknom.com/"&gt;Link Nom&lt;/a&gt;&lt;br /&gt;&lt;a href="http://linkbook.pcgraphicsolutions.com"&gt;LinkBook&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.findsome.info" id="R2EB38B"&gt;Findsome.info&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bmvg.info/"&gt;BMVG Link Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ewebindex.com"&gt;eWeb Index Directory - URL Submission&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.epot.ca/"&gt;epot.ca&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.enterwork.net/directory/"&gt;Enterwork Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dynn.org"&gt;Dynn.Org Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.duanegartman.com/" id="R9F1572"&gt;Duane Gartman - Seo Friendly Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dpbtin.com/"&gt;DPBTIN Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dirsubmission.net/"&gt;Dir Submission WebDirectory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.diroot.com/" target="_blank" title="Free Web Directory"&gt;Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directorymember.net"&gt;Directory Member Website Listings&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directoryjp.com/"&gt;&lt;b&gt;directoryJP&lt;/b&gt;&lt;/a&gt; - a general web directory with free links.  submit today.&lt;br /&gt;&lt;a href="http://mountain-net.com/" id="R0"&gt;Mountain Net&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.getinsearchengines.com"&gt;Get In Search Engines&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directoryvault.com"&gt;DirectoryVault&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dir-submission.com" id="RDA30DE"&gt;Seo friendly directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.wtslink.com" id="R4B0F4E"&gt;WTS Link Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.skypemedia.com/" id="RBAD7EE"&gt;Skype Media Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.777media.com/" id="RB08AB2"&gt;Seo friendly web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xland.info/" id="R6843DE"&gt;Xland Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dir-submission.com/" id="RD7C59A"&gt;Seo friendly directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directory-link.info/" id="R22F930"&gt;Directory Link&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.allfreecoupons.com/target.html"&gt;Target coupons and promo codes&lt;/a&gt;Sfind coupon codes for Target.com or any other online discount store with allfreecoupons.com.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://directory.portalit.net/" title="Add url to Portal IT Directory" target="_blank"&gt;Portal IT Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.idirectconnect.com/"&gt;Idirect Connect Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.claims4free.co.uk/forms/work-related-injury.html"&gt;Work Injury Claim&lt;/a&gt; - offering information and locating available services for accident victims.&lt;br /&gt;&lt;a href="http://www.sitetutor.us/"&gt;SiteTutor&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gdirectory.info/"&gt;gdirectory Website directory for all directory listings&lt;/a&gt;gdirectory Website directory&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tsection.com/" target="_blank" title="Tsection - Great places to visit on the net!"&gt;Tsection Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.info-listings.com/"&gt;info-listings&lt;/a&gt;&lt;br /&gt;&lt;a href="http://oast.com/"&gt;OAST - The Home of Top Sites&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.buy-modern-art.co.uk/" id="RCD5C81"&gt;Buy Modern Art Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/www.firetown.com"&gt;www.firetown.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.speedydirectory.com/" id="RBD8BAA"&gt;Speedy Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/directory.xperts.ro"&gt;directory.xperts.ro&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.urlcan.com/" target="_balnk"&gt;UrlCan Web Directory&lt;/a&gt; - Direct link to your site for free.&lt;br /&gt;&lt;a href="http://www.itzalist.com/computers.html"&gt;!tzalist Computers Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://artoolinks.com/"&gt;Artoo Links - SEO Friendly Directory Droid&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.clickmybrick.com/"&gt;Click my Brick Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.d911.net/"&gt;D911.NET Free Link Directory&lt;/a&gt; - This is the link directory where you can submit the URL to your homepage. Powered by PHP Link Directory.&lt;br /&gt;&lt;a href="http://www.blogger.com/dir.ajnin.com"&gt;dir.ajnin.com &lt;/a&gt;&lt;br /&gt;&lt;a href="http://dir.mymaldives.com/" id="R89F2E2"&gt;Maldives Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directory.datenautobahnraststaette.de/"&gt;Bookmark Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/directory.helpedia.com"&gt;directory.helpedia.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directory.ldmstudio.com/" title="web directory" target="_blank"&gt;Ldmstudio Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.seofriendlydirectory.co.uk/"&gt;Seo Friendly Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.portalit.net/" title="Add url to Portal IT Directory" target="_blank"&gt;Portal IT Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.seohyd.com/"&gt;Seo Friendly Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.seo-poland.com/" id="R6BDAA1"&gt;SEO Poland Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://domain-link-exchange.com/" id="R0"&gt;Domain Link Exchange&lt;/a&gt;&lt;br /&gt;&lt;a href="http://71k.net/"&gt;71K.NET - Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.anetdirectory.com/"&gt;A Net Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dir.yonan.ro/" id="R0"&gt;Yonan Research Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.askbee.net/" id="RB3E346"&gt;AskBEE Free Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.kasan.us/"&gt;Kasan Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.profitgeek.com/"&gt;Profit Geek Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rankorama.de/" target="_blank"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://evmina.com/"&gt;EVMINA - Web Directory and Searhengine&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.clarib.com/"&gt;Clarib Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bindexed.com/"&gt;Bindexed.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.seo-team.org/"&gt;SEO TEAM&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directorybin.com"&gt;Directory Bin&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.freewebsitedirectory.com"&gt;Free Website Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ddsx.com"&gt;Digital Directory Service | Increase Web Traffic, free submissions!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.alistdirectory.com"&gt;A List Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.alistsites.com"&gt;A List Sites&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.Alvz.com" id="R258DCF"&gt;Alvz.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.anaximanderdirectory.com/"&gt;Anaximander Directory&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9188371100743875536-3909294507355031853?l=sghazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sghazi.blogspot.com/feeds/3909294507355031853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9188371100743875536&amp;postID=3909294507355031853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3909294507355031853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9188371100743875536/posts/default/3909294507355031853'/><link rel='alternate' type='text/html' href='http://sghazi.blogspot.com/2006/12/apache-installation-in-this-tutorial.html' title='SEO - A Long List of Free Web Directories'/><author><name>Shahryar Ghazi</name><uri>http://www.blogger.com/profile/14722642704007330333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
