Need to write my first web application - scratching head

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello all,

I'm a longtime programmer (embedded with a smattering of desktop stuff
as well) who knows very little about web programming.  Right now I am
developing the prototype of a multi-user application in MSVC++, but I
think it would make more sense to redo the app as a web application
(which I know almost nothing about, remember).  From poking around I
see that PHP is a fairly mainstream candidate for me to consider.
Now, I will continue to poke around in this group and on the web to
gather the fundamentals as to how I need to proceed, but in the
meantime I'm hoping for a few words of wisdom.

So, regarding developing a web application w/ a small database, what
are the key things I need to know?  What are the key things I need to
avoid?  How can I maximize my chances of success and minimize my
chances of throwing my computer off the balcony?

One requirement of this application is to be able to print from the
client computers, so I presume some code will need to be located there
as well as on the server.  What is the typical way to do this?

Thanks for any and all tips.


Re: Need to write my first web application - scratching head

Oh, I forgot one important item.  There will be cases where my
application must run stand-alone on a single client machine.  For a
web-based app that would seem to involve having the server running on
the client machine itself.  Is this doable?  Is it a standard


Re: Need to write my first web application - scratching head

Mike Silva wrote:
Quoted text here. Click to load it

Picking a technology always involves looking at it from a security
perspective - can you load it onto a desktop and not have someone that
needs to execute it NOT be able to view/modify the code? (Security hole
here). PHP requires a server (IIS, APACHE, etc...)

Next, an understanding for the uses of PHP and why you pick one
technology over another - take the time to read this snippet from the
PHP for Windows install docs.

"   Before starting the installation, first you need to know what do you
want to use PHP for. There are three main fields you can use PHP, as
described in the What can PHP do? section:

      * Websites and web applications (server-side scripting)
      * Command line scripting
      * Desktop (GUI) applications

    For the first and most common form, you need three things: PHP
itself,a web server and a web browser. You probably already have a web
   browser, and depending on your operating system setup, you may also
have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows).
You may also rent webspace at a company. This way, you don't need to set
up anything on your own, only write your PHP scripts, upload it to the
server you rent, and see the results in your browser.

    In case of setting up the server and PHP on your own, you have two
choices for the method of connecting PHP to the server. For many servers
PHP has a direct module interface (also called SAPI). These servers
include Apache, Microsoft Internet Information Server, Netscape and
iPlanet servers. Many other servers have support for ISAPI, the
Microsoft module interface (OmniHTTPd for example). If PHP has no module
support for your web server, you can always use it as a CGI or FastCGI
processor. This means you set up your server to use the CGI executable
of PHP to process all PHP file requests on the server.

    If you are also interested to use PHP for command line scripting
(e.g. write scripts autogenerating some images for you offline, or
processing text files depending on some arguments you pass to them), you
always need the command line executable. For more information, read the
section about writing command line PHP applications. In this case, you
need no server and no browser.

With PHP you can also write desktop GUI applications using the PHP-GTK
extension. This is a completely different approach than writing web
pages, as you do not output any HTML, but manage Windows and objects
within them. For more information about PHP-GTK, please visit the site
dedicated to this extension. PHP-GTK is not included in the official PHP

Re: Need to write my first web application - scratching head

Mike Silva wrote:
Quoted text here. Click to load it


I think your project is better suited to MSVC++.

If you write this as a web app, you'll need a web server.  If the web
app needs to run standalone, you'll need to install a web server on the
standalone machine.

Additionally, from PHP you have only partial control over how the page
is displayed or printed.  Validated HTML code will give you a
recommendation, but the user's browser always has the final word (i.e.
what happens if the browser is using larger than normal fonts?).

The same goes for printing.  You have no way to tell from the PHP end
what the characteristics of the printer are, so you have no way to
format the page to make maximum use of the printer.

There are a lot of uses for PHP and a web app, but I don't think this is
a good one.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Need to write my first web application - scratching head

Quoted text here. Click to load it

Thanks for the comments.  In one sense I'm relieved, since the thought
of learning a bunch of new stuff in mid-stream was a bit daunting.
And I did suspect that the printing requirement and the single-machine
requirement might be problematic.


Re: Need to write my first web application - scratching head

Mike Silva wrote:
Quoted text here. Click to load it

you have answered well grasshopper...

Re: Need to write my first web application - scratching head

Quoted text here. Click to load it
Quoted text here. Click to load it

Not at all - although the OPs lack of experience with PHP but skills
elsewhere might support such an assertion.

From server side, you can force a browser to display a print dialog
(actually using javascript) for an HTML page or display a PDF file or
call the download of a server-side mail-merged document, but you can't
write directly to the client's printer. But you can write directly to
an printer the server is configured for (permissions allowing). In
that case its simply a matter of getting your content into the

There are a couple of good PDF libraries, or you could do a straight
replacement into a text or postscript file.

Of course if you're a C wizard you could always write your activeX
control to download and despatch the print job at the client.


Re: Need to write my first web application - scratching head

Quoted text here. Click to load it

I'm going to go astray of the PHP gods for you, but I would seriously
recommend that, since you already have a background, Visual Basic (not
free) and visual Basic .NET (two entirely DIFFERENT animals regardless
of their name), are RAD programs and can do exactly what you want.  The
compiler comes with it, and the executables for delivery are very small
compared to most other languages.
   I would recommend VB version 6 with SP6 and the MSDN Help system.
VB.NET is OK too but more complex and not necessary for what you want to

I do  not mean to say you can not do it in PHP; you definitely can, and
likely for a lot less money.  A local server on your system, PHP and
you're ready to write code.  I am only pointing out another route - the
one I would follow if it were me.
   I should also mention I am not a guru in either language; only
experienced in the areas I am interested in; self taught mostly.

My 2 , FWTW <g>


Site Timeline