Hi all Real beginners questions these ! I just put my first site online yesterday http://www.anmaco.f2s.com and the visitors book doesn't work. I can't read to or write without a server error message. The support from the site managers have given me a check list but I don't know how to do some of the things on it - can you help? I designed the site on a Windows system with Dreamweaver (is this relevant)? Here are the appropriate bits from the checklist : Has the execute bit been set on the Perl file? HOW? Ensure the script and the directory the script is in are not writable by others - AGAIN - HOW? Has your base path been set correctly? The base path given is /web/sites/162/anmaco/www.anmaco.f2s.com but I don't know where to use it? My scripts are in my cgi-bin right inside my site directory. I feel I am missing some vital point here. It also suggests I might try to chmod 755, but again I don't know how. What a dunce! Thanks for any help you can give me! Just in case it helps here is my coding, which works just fine on my XITAMI server on my local disk! Sorry about the French/English mix.
#!/usr/bin/perl # Ouvrir le fichier $i=0; if (open (FICHIER, "<gbook.txt") != false) { # flock (FICHIER, 1); # verrouille en lecture $max=0; while (<FICHIER>) { push(@Lignes,$_); $max++; } # flock (FICHIER, 8); # déverrouille close (FICHIER); # Sortie vers le navigateur : print "Content-type: text/html\n\n"; print <<html_fin; <HTML> <HEAD> <TITLE>Visitor's Book</TITLE> </HEAD> <body bgcolor="#FFFFFF" background="../Backgrounds/parch2.jpg"> <img src="../Pictures/ourvisitorsbook2.jpg" width="758" height="231"> <p align="center"> </p> <p align="center"><font face="Comic Sans MS, Arial" size="+2" color="# +652C16">Here are the messages we have received</font></p> <p> </p> html_fin for ($i=0; $i<$max; $i+=6) { $time = @Lignes[$i+0]; $PNom = @Lignes[$i+1]; $NomFam = @Lignes[$i+2]; $email = @Lignes[$i+3]; $subject = @Lignes[$i+4]; $body = @Lignes[$i+5]; print "<B>", $PNom, " ", $NomFam, "</B> (<B><A HREF=\"mailto:", $email, "\">", $email, "</A></B>)<BR><BR>\n"; print "wrote on <B>", $time, "</B> on the subject <B>", $subject, "</B>:<BR><BR>\n"; print "<I>", $body, "</I><HR>\n"; } print <<html_fin; <p align="center"><font face="Comic Sans MS, Arial" color="#652C16">"I +f you would like, you can also <a href="../Drop_us_a_line.htm">write +a message</a> in our Visitor's Book, or <a href="../Index.htm">go bac +k</a> to the Homepage.</font> </p> <p> </p> <p align="center"><font face="Comic Sans MS, Arial" color="#652C16"><i +><font size="+1"><b><u>Have fun!</u></b<</font></i></font></p> <p>  </p> </BODY> </HTML> html_fin } else # erreur fichier { print <<html_fin; <HTML> <HEAD> <TITLE>Erreur</TITLE> </HEAD> <BODY> <B>Impossible to read the Visitor's Book</B> <P> Please <A HREF="../index.html">go back</A> to the Homepage. <P> <I><B>Have fun!</B></I> </BODY> </HTML> html_fin } exit;
AND
#!/usr/bin/perl # Exploiter les variables d'environnement : if($ENV{'REQUEST_METHOD'} eq 'GET') { $Data = $ENV{'QUERY_STRING'} } else { read(STDIN, $Data, $ENV{'CONTENT_LENGTH'}) } $i=0; @ChampsFormulaire = split(/&/, $Data); foreach $Champ (@ChampsFormulaire) { ($name, $value) = split(/=/, $Champ); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/<!--(.|\n)*-->//g; $value =~ s/\n/<BR>/g; # transformer Newline en <BR> $Formulaire[$i] = $name; $i = $i + 1; $Formulaire[$i] = $value; $i = $i + 1; } # Extraire date et heure $ValActu = time(); $HeureActu = localtime($ValActu); # ouvre le fichier pour l'adjonction if (open (FICHIER, ">>gbook.txt") != false) { # flock (FICHIER, 2); # verouille en écriture print FICHIER "$HeureActu\n"; for ($i=0; $i<=$#Formulaire; $i=$i+2) { print FICHIER $Formulaire[$i+1], "\n"; } # flock (FICHIER, 8); # déverrouille close (FICHIER); # Sortie vers le navigateur : print "Content-type: text/html\n\n"; print <<html_fin; <HTML> <HEAD> <TITLE>Merci</TITLE> </HEAD> <BODY> <B>Thank you for adding to my Visitor's Book.</B> <P> You can now ' <A HREF="read_lo.pl">read</A> your message, and all the others... or <A HREF="../index.html">return</A> to my Homepage. <P> <I><B>Have fun !</B></I> </BODY> </HTML> html_fin } else # erreur fichier { # Sortie vers le navigateur : print "Content-type: text/html\n\n"; print <<html_fin; <HTML> <HEAD> <TITLE>Erreur</TITLE> </HEAD> <BODY> <B>Impossible to write in the Visitor's Book</B> <P> You can <A HREF="../index.html">return</A> to my Homepage. <P> <I><B>Have fun !</B></I> </BODY> </HTML> html_fin } exit;

In reply to Server Error Messages by anmaco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.