Kann mir jemand helfen??
Also ich wollte erst ein eigenes klitze kleines Gästebuchlein
auf meiner Seite zu installieren. Natürlich habe ich auch an Surfkosten
gedacht. Und wollte erst das auf meinem PC (mit "Windoff 98") mit Hilfe
eines Programmes (OmniHTTPd - so gennanter "Localserver"), aber das klaaaapt
einfach nict mit CGI-Gästebuch. Obwohl ich schon alles was ich konnte,
suchte ausprobiert.
Vielleicht mach ich was falsch:
Pfadeingabe und sowas.
hier sind diese dateien:
1 Datei
guestbook.pl (den hab ich natürlich in guestbook.cgi umgewandelt wie in selfhtml/tgbc.htm beschrieben steht
der enthaltet diese code:
#! /usr/bin/perl
# WEB-IT Internet Services
# Guestbook ver 1.1
#-------------------------------------------------------------------#
Installation Instructions:
#-----------------------------
1: change the settings below to what your settings are!!!
2: Copy this file guestbook.pl to your cgi-bin
3: Copy the guestbook.html and add.html to a separate directory
eg /guestbook/
4: chmod guestbook.pl to 755
5: chmod guestbook.html and add.html to 777
6: chmod /guestbook/ to 777
7: change all of the settings below to your servers settings
8: make sure to set add.html to call guestbook.pl
#-------------------------------------------------------------------#
This program is Freeware and shall be distributed freely
Do not change the Header/Credits in any way.
WEB-IT Internet Services
http://webit.ml.org/
e-mail webit@iname.com
WEB-IT CGI Scripts Archive:
http://webit.ml.org/scripts/
e-mail webit@iname.com
#-------------------------Server Settings-----------------------------#
UNIX path of Guestbook.html
$guestbook_file = "/data1/hypermart.net/secure/guestbook/guestbook.html";
URL to guestbook.html
$guestbook_url = "http://secure.hypermart.net/guestbook/guestbook.html";
TITLE of the website
$site_name = "WEB-IT Secure Services";
Your E-mail address
$your_email = "webmaster@secure.hypermart.net";
#-----------------------------Settings---------------------------------#
$top = 1; # 1 = add to top 0 = add to bottom
$allow_html = 0; # 1 = allows html 2 = does not allow html 0 = dont
$redirect = 1; # 1 = redirect to guestbook 0 = print return page
Run Program
@day = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
Get input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
Parse data
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
do the unencoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.\n)*-->//g;
if(! $allow_html) {
$value =~ s/<([^>]\n)*>//g;
}
$FORM{$name} = $value;
}
&incomplete unless $FORM{'name'};
&incomplete unless $FORM{'city'};
&incomplete unless $FORM{'location'};
&incomplete unless $FORM{'comments'};
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
$mon += 1;
#$month1 = $mon;
if($mon = 1) {
$month1 = "January";
}
elsif($mon = 2) {
$month1 = "February";
}
elsif($mon = 3) {
$month1 = "March";
}
elsif($mon = 4) {
$month1 = "April";
}
elsif($mon = 5) {
$month1 = "May";
}
elsif($mon = 6) {
$month1 = "June";
}
elsif($mon = 7) {
$month1 = "July";
}
elsif($mon = 8) {
$month1 = "August";
}
elsif($mon = 9) {
$month1 = "September";
}
elsif($mon = 10) {
$month1 = "October";
}
elsif($mon = 11) {
$month1 = "November";
}
elsif($mon = 12) {
$month1 = "December";
}
else {
$month1 = "Not Available";
}
$date = "$day[$wday], the $mday. of $month1 19$year\n";
open(GUESTBOOK, "$guestbook_file") die "Can't open GUESTBOOK: $guestbook_file\n";
@guestbook =<GUESTBOOK>;
close(GUESTBOOK);
open(GUESTBOOK, ">$guestbook_file") die "Can't open GUESTBOOK: $guestbook_file\n";
foreach $line (@guestbook) {
if($line =~ /<!--Begin GuestBook-->/i) {
if($top) {
print GUESTBOOK "<!--Begin GuestBook-->\n";
}
print GUESTBOOK "<DL>\n";
if($FORM{'email'}) {
print GUESTBOOK "<DD><I><B><A HREF="mailto:$FORM{'email'}">
$FORM{'name'}</A></B> - $FORM{'city'}, $FORM{'location'}</I>\n";
}
else {
print GUESTBOOK "<I><B>From:</B> $FORM{'name'}</I><BR>\n";
}
if($FORM{'url'}) {
print GUESTBOOK "<DD>Homepage : <A HREF="$FORM{'url'}">$FORM{'htitle'}</A>\n";
}
print GUESTBOOK "<ul><p>\n";
print GUESTBOOK "$FORM{'comments'}\n";
print GUESTBOOK "</ul>\n";
print GUESTBOOK "<p><I><font size=2>\n";
print GUESTBOOK "signed on $date at $hour:$min:$sec\n";
print GUESTBOOK "</I></font>\n";
print GUESTBOOK "</DL>\n";
print GUESTBOOK "<HR>\n";
if(! $top) {
print GUESTBOOK "<!--Begin GuestBook-->\n";
}
}
else {
print GUESTBOOK "$line";
}
}
close(GUESTBOOK);
if($redirect) {
print "Location: $guestbook_url\n\n";
}
else {
print "Content-Type: text/html\n\n";
print qq!
<H1>Your GuestBook Entry has been Submited!</H1>
Your guestbook entry has been successfully added to the
<A HREF="$guestbook_url">guestbook</A>.
You may need to click reload to view your guestbook entry.<P>!;
}
sub incomplete {
print "Content-Type: text/html\n\n";
print qq!
<H1>Incomplete Form!</H1>
One of the Required Fields Was not filled in. Please press the
back button on your browser and try again.<P>
The following fields are required name,address,city,country,email,website<P>!;
die;
}
############################################################ #####################
2 Datei
add.html:
<HTML>
<HEAD><TITLE>Sign My GuestBook</TITLE></HEAD>
<BODY bgcolor="Black" text="White">
<H2 ALIGN=CENTER>Sign My Guest Book</H2>
<hr>
<FORM METHOD="POST" ACTION="/cgi-bin/guestbook.cgi">
<PRE>
Your name <INPUT type=text size=60 maxlength=256 name="name">
E-mail address <INPUT type=text size=60 maxlength=256 name="email">
City <INPUT type=text size=60 maxlength=256 name="city">
Country <INPUT type=text size=60 maxlength=256 name="location">
Homepage URL <INPUT type=text size=60 maxlength=256 name="url">
Homepage Title <INPUT type=text size=60 maxlength=256 name="htitle">
comment
<TEXTAREA rows=9 cols=51 name="comments"></TEXTAREA>
<br></br>
<INPUT type="submit" value="submit"> <INPUT type="reset" value="clear form">
</PRE>
</FORM>
</BODY>
</HTML>
################################## ##################################
3 Datei
guestbook.html
<TITLE>Welcome to My Guestbook</TITLE>
<BODY bgcolor="Black" text="white">
<CENTER>
<H1>Welcome to My Guestbook</H1>
</CENTER><P>
<A HREF="add.html"><B>SIGN MY GUESTBOOK!</A></B><P>
<Hr><P>
<!--Begin GuestBook-->
</BODY>
################################## ##################################
was soll ich machen?????????
GROßEN DANK
IM VORAUS!!!!!!!!!!!!!!!!!!!