Announcement

Collapse
No announcement yet.

CGI Tutorial Part 2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    That cookie example on http://www.basicrocks.com/cgi_part3.htm ...

    It says "Cookies are passed to the CGI application in the programs enviroment table...." however..
    The example at first shows how it should be sent, maybe it would be nice to parse the headers sent instead?

    Reason is that IIS is actually parsing the headers and places it in the environment for you.

    I think it would make things slightly more understandable since the headers are often a forgotten thing and spy programs can reveil so much but often are not used.

    I mean, one can really learn from using an MSIE connecting and spying what headers are sent and received.
    It says me more how things work than 'pre-chewed' things like the environment variables (which still needs to be described of course).

    hellobasic

    Comment


    • #22
      helpful

      I found your tutorial on CGI. I am just now taking a XHTML/Javascript course so this topic is very interesting to me. Thank you for your efforts here

      Comment


      • #23
        My pleasure Tom!

        I'm actually working on an update, including a section on using SQLite with PBCgi's. I've been fooling around with some advanced scripting and template based concepts too. I'll be posting some news here when their posted and ready to go....
        Software makes Hardware Happen

        Comment


        • #24
          testing your tutorial locally

          Another dumb question:
          I read your tutorial and all the replies but I still have this question:
          If I can test the .htm locally i.e. by using file>open>browse and finding the .htm on my laptop, why can't I run the CGI you supplied locally too?

          Thanks.

          Comment


          • #25
            Originally posted by tom kroto View Post
            Another dumb question:
            I read your tutorial and all the replies but I still have this question:
            If I can test the .htm locally i.e. by using file>open>browse and finding the .htm on my laptop, why can't I run the CGI you supplied locally too?
            Thanks.
            An HTML page is 'static'. The html file contains all the formatting code and data necessary for the web browser to display it.

            A CGI application is a server-based program that feeds dynamic data to the web server to be sent back to the browser.

            The CGI application doesn't 'talk' directly to the web browser, it needs the web server to accept the data from the cgi application and then pass it on to the browser.

            IF you're CGI application actually created a file on your disk, you could 'open' it directly because the contents of that file would be static HTML information. However, to be useful, you want the cgi application to be more-or-less interactive so you don't have to keep creating disk files and requesting them individually from your browser. You want the cgi application to create HTML code that is sent directly to your browser for display. This can only be done with a server that manages the requests from the browser and the responses from the cgi applications.

            For debugging, you can easily install a simple web server on your local PC. In fact, there are lots of WAMP packages (Windows Apache/MySQL/PHP) you can install in a matter of minuets for testing purposes.
            Software makes Hardware Happen

            Comment

            Working...
            X