Archive for the ‘ Microsoft ’ Category

WordPress, HTML, CSS, PHP, Javascript And More Cheat Sheets

Cheat sheets are really helpful in revising the codes as there are so many codes which we cannot remember always but cheat sheets are of great help in keeping yourself updatedwith the codes.

Cheat sheets are also helpful for beginner developers and designers in learning and remembering codes better. A truly great resource for upcoming developers.

The purpose of this post is to provide all the cheat sheets useful for designers and developers at one place. A mega collection of cheat sheets which contains HTML, CSS, JAVA, PHP, Database SQL, WordPress, Aspx, SEO and many more other useful cheat sheets which you will find in this post. Most of the cheat sheets are available in printable format for a handy use of these resources.

HTML/XHTML/XML

CSS

PHP

ASP

Database/SQL

JavaScript

WordPress

SEO

REWRITE And .HTACCESS

Photoshop

Windows

Mac

Browser Shortcut Cheats

Bookmark and Share
Advertisements

WAMP guide

Sooner or later you’ll want (and need) a local web server on your machine to test your websites.

When talking about web server software one usually talks about Apache. Apache is one of the most widely used web servers nowadays and is also free of charge unlike Microsoft’s web server technology.

Apache supports a variety of modules and plug-ins that let you configure your server just the way you want. WAMP (Apache, PHP and MySQL for Windows) provides the popular combination of Apache with the PHP server-side language and the MySQL database in one easy-to-install package

First you’ll have to download the latest version of WAMP. Once downloaded double-click the file to launch the installer.

The setup is pretty self-explanatory. At one point you will be asked where you want to have your www root folder. This www folder is simply where your web pages will be loaded from. It doesn’t really matter what you choose and you can always change it later.

After the installation you should have a fully functional Apache web server with PHP and MySQL.

Starting WAMP

To launch your web server go to Start › All Programs › WampServer (or wherever you installed WAMP to) and click start WampServer.

You’ll notice a small icon in the bottom right corner of your screen changing from red to white. That was just the WAMP server that booted up. By left-clicking on the icon you’ll get to the server options. The meaning of the icon status changes are shown below:

WAMP offline modeWAMP offline mode

Offline mode means that only you, from your computer, can access your server. External access will be blocked (indicated by the black lock in the icon). This is the default setting and should always be used for website testing.

WAMP online modeWAMP online mode

Online mode on the other hand means that everyone can access your server from anywhere. This is option is for using your computer as a live web server should you intend to do that.

Accessing your server locally

Now we’re going to try to access your server locally with a web browser:

  1. Make sure WAMP is up and running in offline mode.
  2. Enter localhost into your browser bar and hit enter.

If you didn’t provide a different www root directory when installing WAMP the default page should have loaded:

WAMP default page WAMP default page

What localhost does is simply to look for an index file (in this case index.php) in your www root folder and load it into the web browser. You can go to that folder (usually C:/Program Files/wamp/www/) and check for yourself that such file indeed exists.

You could now start building your own website by replacing the index file with your own index file (index.php, index.html, …). Every time you’d have made a change to your website you’d hit F5 in your web browser to load the most recent version.

Accessing your server from anywhere

Suppose you’ve created a cool website and want to show it to your friend who’s living halfway around the globe, sitting in front of his computer. You only have your website on your local machine. Very similar to the looking up a web page with its IP example you’re going to tell your buddy to enter your IP into his web browser bar.

Your friend’s web browser will then try to establish a connection with your computer over port 80 (standard port for speaking to web servers). Apache will catch this request and send the index page located in your www root folder to the web browser which in turn will interpret its containing HTML code and display it as a good old web page.

However, if WAMP runs in offline mode your friend will see the following in his web browser upon entering your IP:

WAMP external access error WAMP external access error

Try it for yourself:

  1. Make sure WAMP is running in offline mode.
  2. Enter your IP 121.246.243.112 into your web browser bar and hit enter.

To allow external connections to your server you have to restart WAMP in online mode.

  1. Left-click the WAMP icon and select Put Online.
  2. Wait for the icon status to change to white again.
  3. Enter your IP 121.246.243.112 into your web browser bar and hit enter.
  4. If you get the same forbidden page as before hit F5 to let the browser load the newest version.
  5. If it’s still not working you probably have to enable port 80 forwarding in your router configuration.

Finally your buddy can see your homepage!

WAMP external access success WAMP external access success

Changing Apache’s www root directory

Sometimes it’s necessary to change your current www root folder to something else. Maybe you have all your work files on a different partition than where you installed WAMP to or you have several websites you’re working on and need to make one of them your primary site for a while (the one that shows up when entering localhost).

Anything that has to do with Apache configuration can be done within a file called httpd.conf.

  1. WAMP provides quick access to certain important files, one of them being httpd.conf.
  2. Left-click WAMP icon and select Config files › httpd.conf.
  3. The file will probably open up in Notepad.
  4. Press Ctrl+F and enter documentroot.
  5. Make sure case sensitive search is disabled and hit enter.
  6. You should find a line that looks like DocumentRoot “C:/Program Files/wamp/www/”.
  7. Copy that line then put a # in front of it: #DocumentRoot “C:/Program Files/wamp/www/”.
  8. Paste the copied line just below and adjust it to where your custom root folder is located (e.g. DocumentRoot “C:/my_cool_site/”).
  9. Resume the search (usually by pressing F3) and you’ll find a line like: <Directory “C:/Program Files/wamp/www/”>.
  10. Again copy the line, put a # in front, paste copied line below and adjust it (e.g. <Directory “C:/my_cool_site/”>).
  11. Save and close the file.

Whenever you make a change to httpd.conf you have to restart Apache for it to take effect. The # we’ve added in front of the old lines turns them into a comment which Apache ignores. We just added them so that we can easily switch back to an old configuration by uncommenting the lines.

  1. Left-click the WAMP icon and select Apache › Restart Service.
  2. Wait for the icon status to change to white again.

The root directory should now have changed to then one you’ve entered in httpd.conf. You can test this by entering localhost in your web browser. The index page in that folder (or the lack thereof) should show up now.

Final words

You now have all the tools necessary for developing and testing dynamic and database driven websites on your local machine! If you installed WAMP to try out the tutorial examples you just need to copy the website template into a new index.html or index.php text file and place it in your Apache root directory.

What is WAMPServer?

WAMP is a form of mini-server that can run on almost any Windows Operating System. WAMP includes Apache 2, PHP 5 (SMTP ports are disabled), and MySQL (phpMyAdmin and SQLitemanager are installed to manage your databases) preinstalled.An icon on the taskbar tray displays the status of WAMP, letting you know if;

a) WAMP is running but no services are opened (the icon will appear red),

b) WAMP is running and one service is opened (the icon will appear yellow)  or

c) WAMP is running with all services opened (the icon will appear white).

Apache and MySQL are considered to be services (they can be disabled by left-clicking on the taskbar icon, guiding your cursor over the service you wish to disable and selecting “Stop Service”).

The files/web pages that are hosted on your WAMP server can be accessed by typing http://localhost/ or http://127.0.0.1/ in the address bar of your web browser. WAMP must be running in order to access either of the above addresses.

If you would like to share your files/web pages with others, click on the icon located on your taskbar tray and select “Put Online.” You must have access to the Internet in order to continue.

Send the people that you would like to give access to the files/web pages hosted on your WAMP server your IP Address. Your can find your IP address here:

Your IP Address and Browser Details

Your IP: 218.248.25.5
Hostname: 218.248.25.5
Web browser: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2

(notes: IP address based on your current browser)

If you are a dial-up user or if you have a dynamic IP Address (one that changes every so often), you will need to keep the people that have your IP Address updated every time you connect to the internet.

You can download WAMPServer from WampServer.com.

Adobe Flex beats Silverlight every time

Both Adobe and Microsoft are fighting hard to be the preferred vendor for RIA development. They both are awesome tools that will change the way we use the web in years to come. But when it comes to deployment, there is only one option for me and that is Flex. The main reason, 99% of all PCs and laptops have Flash installed on it. If you look at this chart you don’t even see the Silverlight plugin. That is because it is so new that it will take a while to penetrate the market. But even Microsoft’s most popular desktop add-on, Microsoft Windows Media Player, only reaches 83.6% of the desktops. Silverlight will struggle to get widely adopted just like Winforms did. The problem with Winforms is it requires the .Net framework to be installed on the client PC. According to Microsoft’s own website, the .Net framework is at about a 58% penetration rate. Keep in mind that the framework only comes into play on Windows operating systems. I don’t know about you, but I won’t have any success convincing all of my 500 manufacturer and retailer clients to install the framework on all of their desktops. But my Flash applications will work fine since they all already have Flash installed, regardless of which operating system they run. Microsoft did learn from the failed approach with Winforms and addresses this issue with the Silverlight plugin. The problem now for Microsoft is how will they get the necessary penetration that customers like me require. Microsoft is also working with the open source community so Silverlight will work on Linux (see Moonlight). This is a great strategy. But I can’t wait 2-3 years until Silverlight penetrates over 90% of the laptops and PCs across all operating systems. Don’t get me wrong, I like what I have seen (download plugin at own risk) from Silverlight as far as ease of use and functionality. If you are building applications for users that you have total control of their desktop, then Silverlight is an awesome choice for you. But for those of us who have no control over the client, Adobe Flex beats Silverlight every time.