A reader writers:
“I’m trying to create a guestbook using the forms and CGI’s, but I’m stuck as to how to link the form to the server. The sign page is at <guestadd.html> and I would like the view page to be at <guestbook.html>. What I did was use a somewhat template form of guestbook provided by our web host, and, after editing the sign page (new additions are “Current Division” and “Mu Alpha Theta Chapter”), wanted the additions to appear on guestbook.html, but I don’t know how to do that…”
I think that the most confusing part of the Web is the Common Gateway Interface, and much of that is because there’s programming involved. 🙂 Seriously, you’ve got the basics figured out, but remember that the guestbook script that you’re using from your Web hosting provider is a program, so if you want to modify the input fields, you need to modify the script to see them, accept them, and include them in the output file. Talk with your admin about whether you can have a copy of their script in your own directory so that you can make these changes.
In terms of view page link, more likely than not it’ll be a .cgi URL not a .html URL as you indicate in your message: what’s their recommended link for allowing someone to just see the guestbook without adding a new entry?
Still have questions? Come back and post a Q&A and we can discuss this further!
You have done an exceptional job in creating and designing this website. My Congratulations to you!!!
An additional note: All HTML pages are fundamentally static: you create the page you want, you preview it in your browser, and you’re good to go. It’s uploaded to your server and it’s done. With CGI, however, everything’s different. A CGI-based page is generated on-the-fly as the output of a program that’s run on your server.
That means that for a guestboook to work, you need to have a cgi program that can accept the guestbook data, do something with it (probably write it to a file or insert it into a database) and output a meaningful result (probably a ‘thanks for submitting your comments’ message). Typically, you’d have a static HTML page that asks for entries (a form, built within the <form> tag pair) which feeds its data to your add-guestbook-entry CGI script. That script then either outputs the existing guestbook as a nice HTML page, or outputs a ‘thank you’. Then you need a second script (or the same script with enough smarts to see if there’s a new entry or just a display request) that outputs the guestbook data.
This is pretty complex just writing about it here, so here’s a good tutorial by Joel Burns with extensive example listings.