Re: Help with PERL guestbook (newbie)

From: Jim Gibson (jgibson_at_mail.arc.nasa.gov)
Date: 06/23/04


Date: Wed, 23 Jun 2004 10:13:51 -0700

In article <Cc5Cc.30664$U.27309@nwrdny02.gnilink.net>, John ©
<johnjcarbone@nospam.hotmail.com> wrote:

> Okay, I don't know how this newsgroup works, but I will try to post as much
> as I can and hopefully someone can help me. (I don't know much about PERL).

Actually, this newsgroup is defunct. Active Perl newsgroups include
comp.lang.perl.misc, comp.lang.perl.moderated, comp.lang.perl.modules,
comp.lang.perl.tk, and comp.lang.perl.announce, with topics as
indicated.

>
> So I have a script that is to write a guestbook... I have the sign page and
> I have the view page ...

I am guessing that you didn't write this script. You should know that
there is a Perl module to assist with CGI tasks (CGI.pm), including
parsing input data and generating HTML. Try executing 'perldoc CGI' at
a command line prompt to get more info.

Your script doesn't do any file locking. It will run into trouble if
two people try to post a message at the same time. If your script
encounters an error, it will die without writing the proper HTML, and
you will see nothing in your browser.

You might look into a different script for guestbooks. There is one
available at http://nms-cgi.sourceforge.net/scripts.shtml that includes
locking the data file to prevent simultaneous access by two users.

>
> the sign page is at: http://www.sigmachi-iotadelta.com/sign.html
> the view page is at: http://www.sigmachi-iotadelta.com/view.html
> the script is at: http://www.sigmachi-iotadelta.com/cgi-bin/guestbook.cgi
> (uploaded in ascii, I think all the chmod's are correct)
>
> Most times, after I try to post from the sign.html page, I get either page
> cannot be displayed, internal error, access denied, or some other mistake.
> A few times I did get the view.html page, but nothing was written to it.
> Also the 'error' message from the .cgi script does work, if I don't fill out
> comments or name, it will say they are blank.
>
> Any and all help is appreciated... you can direct email me if you like.
>
> Here is a copy/past of the script...

[ long CGI guestbook script snipped ]



Relevant Pages

  • Re: Help with a stragegy for diagnosis
    ... I have a Perl CGI that has work for years. ... first failure and before the second. ... A strategy would be to write tests for the script until you get the same ...
    (comp.lang.perl.moderated)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... This message is one of several periodic postings to comp.lang.perl.misc ... from the documentation provided with Perl. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ...
    (comp.lang.perl.misc)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... This message is one of several periodic postings to comp.lang.perl.misc ... from the documentation provided with Perl. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ...
    (comp.lang.perl.misc)
  • Re: Advice about cgi programming
    ... experience with other scripting languages. ... This might not be the most appropriate group, but since Perl is ... input string to this script in the background and return the result. ... Perl is an excellent choice for writing CGI programs. ...
    (comp.lang.perl.misc)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... comes with the standard Perl distribution. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ... The similarity between CGI response headers (defined in the CGI ...
    (comp.lang.perl.misc)

Loading