spacer
Web Development Tutorials PHP Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Building Desktop Applications in PHP

By Akash Mehta
2008-02-09


Fundamentals

Now, desktop application development is an entirely different cup of tea. It’s not what you’re used to: you’re used to being input-driven, but desktop apps are event driven (Delphi for PHP is the best of both worlds). As a result, before you start developing desktop applications, you’ll have to step back for a moment and examine the differences.

As a web developer, you’re familiar with the basics of web scripting. Client makes request to server, server runs your PHP code through PHP compiler/interpreter, output is sent to client etc. etc. Your entire request has finished very quickly; possibly in less than a second. The user didn’t do anything in between; the data for the request (cookie data, get / post values, server and environment variables etc.) was all set once before your code was run. When executing your script, PHP went from top to bottom, ending at the last line of code in your PHP file. Once it’s finished, the request is gone; the process finished, possibly even the thread killed.

Desktop applications, on the other hand, are nothing like this. Now that we have full-on JS-heavy web applications, you should have a basic understanding of how desktop application development works – think of it like a web application written entirely in JavaScript. It’s heavily event driven, with functions for different events such as a button click or a mouse move, and it keeps going without executing any code. In desktop applications, you first draw the window using some basic UI code, and then wait – just wait. You have to give up a bit of control to the operating system – for example, if you want a menu, you (typically) tell the operating system to draw a menu and to bind some of your functions to the menu items, then let it take care of the rest. It takes quite a while to get used to, but soon enough you’ll get the hang of it, and be building fantastic desktop applications in no time.

Of course, as your applications are written in PHP, you can also reuse all your existing PHP code - well, almost all (HTML output won't exactly help). As a result, once you understand the basics of desktop development, you can be building powerful desktop applications in no time - you could even integrate with your existing web application!



Tutorial Pages:
» Introduction
» Fundamentals
» Benefits of desktop development
» Building desktop applications in PHP
» Further reading


Related Tutorials:
» Web Database Access from Desktop Applications
» CubeCart 3.0 Installation and Configuration
» PHP Site Search Made Easy
» Installing and Configuring Drupal 6.1
» Desktop Application Development with PHP-GTK
» Installing PHP on Windows



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: