|
GUIDE - Guestbbok How do I set up a guestbook on my Web site? In order to have a properly working guestbook, you must follow the setup procedure carefully. The procedure described here differs slightly from procedures offered before, so it is important to read closely. There are actually four parts to the guestbook:
Before you begin, decide where you want guestbook.html and addguest.html to live in your Web site. You will normally want to place guestbook.pl in a CGI directory, although this is not strictly required (because it has the .pl extension, it will execute as CGI from any directory). To begin, the script must be copied to your own Web directory. It cannot be run from the system CGI directory because customization is required. To copy the script, use one of these sequences of commands via Telnet, as described in the FAQ on CGI. For Advanced accounts: cd ~/public_html mkdir cgi-local cp /usr/www/cgi-bin/guestbook.pl cgi-local chmod 755 cgi-local/guestbook.pl For Webmaster accounts: cd ~/public_html cp /usr/www/cgi-bin/guestbook.pl cgi-bin chmod 755 cgi-bin/guestbook.pl Next, use your favorite editor to modify the script. You will need to set four variables within the script itself:
The guestbook.pl script can be further configured with a wide variety of options, set as 1 ("yes") or 0 ("no") inside the script itself:
When you have finished configuring the guestbook.pl script, the rest is fairly easy. Prototypes for the remaining three files (guestbook.html, addguest.html, and guestlog.html) can be found in /usr/local/pair/guestbook/ on the servers. You will need to copy these files to the location(s) you selected in your Web site, and set permissions for the guestbook.html and guestlog.html files as follows: chmod 666 guestbook.html guestlog.html Finally, edit the guestbook.html and addguest.html files. You will need to specify the correct URL for addguest.html inside guestbook.html, if they are in different directories for some reason. You will also need to specify the correct link to your home page, or remove that portion of guestbook.html entirely. You will need to specify two URLs within addguest.html - the URL to the CGI script should be placed in the ACTION field of the FORM tag, and the URL of the guestbook itself should be fixed at the bottom of the file. You can further customize the guestbook.html and addguest.html files in any manner you like. The only restriction is that the <!--begin--> tag must be present in the guestbook.html file; it indicates where new entries should be added. If you are concerned that other users on the system could tamper with your guestbook entries (because the guestbook.html file is world-writable), you can use cgiwrap on your guestbook.pl script. The correct FORM tag in addguest.html then becomes: <FORM METHOD="POST" ACTION="/cgi-sys/cgiwrap/username/guestbook.pl"> ...and you must change $cgiurl in guestbook.pl to: $cgiurl = "http://www.domain.com/cgi-sys/cgiwrap/username/guestbook.pl"; You can then protect your guestbook with: chmod 644 guestbook.html guestlog.html Per qualunque chiarimento contattateci: info@iperweb.com |