CGI Programming

J-term 2005


Instructor: Jeremy Gottlieb
Office: LH307
Extension: x5943


Here are two PHP examples:

query.php: Ask for a query to the mySQL server.
mysql_test.php: Execute the query and return the results.


Here is the Boilerplate for your server programs.

Here is the example Client program


UNIX man pages for every available C function.


What we're going to do in this course:

What we're going to do is learn a couple of different network programming techniques. First we're going to start out learning how to write some simple client/server programs. You'll learn about how to open sockets and write programs that listen to ports for incoming information, and then process that information.

After this, we're going to transition into writing programs that present dynamic content on a web page. We're going to spend the bulk of our time focusing on using PHP and mySQL to manipulate, store, and ultimately present the data being shown on our web pages. We'll also touch on how to do these things with Perl or C++, and might learn a little bit about web design and style sheets along the way.

How we're going to do it:

I hope you weren't really looking forward to using Visual Studio some more, because that's not how we're going to write our programs. We're going to develop our programs in a UNIX environment (specifically Mac OS X 10.3). Most prominently, this means you'll have to learn how to use a command-line interface if you've never used one before. You'll also have to learn how to use a text editor such as Emacs or VI (more on this later).

When we're going to do it:

Here is a rough course calendar: (still a work in progress)

Section 1 - Client/Server programming

  • Jan. 3 - an introduction to UNIX
  • Jan. 4 - How computers talk to each other - the structure of TCP/IP
  • Jan. 5 - Sending and receiving information over the network - sockets
  • Jan. 6 - Writing Client/Server software
  • Jan. 7 - Work day
  • Jan. 10 - Present your programs


    Resources

    Emacs references:

    Unix Manuals
    Emacs Reference Card
    Emacs reference list
    Emacs tutorial

    VI references:

    vi reference
    Unix Manuals
    VI lovers