Make your own free website on Tripod.com

Nether-Book Login

Nether-Book
Not Just any old guestbook

Sign Our Nether-Book

Whats Your name?:
What Do You Think of Our site?

A Free Script by Nethernet Inc

 

Nether-Book Login

Nether-Book
Not Just any old guestbook

You Must Login before you can Admin your Nether-Book

Enter an Admin Password:
A Free Script by Nethernet Inc

 

asdf

Nether-Book Options

Nether-Book
Not Just any old guestbook

Documentation | Revert to Default | Reset Guestbook | Upgrade to Proffesional

Header Page Location:

Edit
Footer Page Location: Edit
Middle Page Location: Edit
Template Page Location: Edit
Allow HTML tags in guestbook Entries?
Guestbook Entries Per Page
Next/Previous File Location: Edit
Thank-You Page Location: Edit
A Free Script by Nethernet Inc

#!/usr/bin/perl # # Copyright 1999 Ilia Mirkin / Nethernet. # Some minor modifications Copyright Ben Congleton Nethernet # # # If you use this script mail ben@nethernet.com and we will add a link to your # site as an example of what Nether-Book can do :-) ############################################################################### # # # Available at Http://www.nethernet.com #will be in the code $main="index.html"; #The main page, for options $set ="options"; #File where options are stored. Has to be chmodded to 777. $pass_file="password"; #File with the encrypted password. #$login="login.html"; #$newpass="newpass.html"; #$reset="clear.html"; #$docs="docs.html"; #Options list: #head The html code that contains the beginning of the page. #foot The html code that contains the ending of the page. #cent The file where the entries will be appended to. #temp The template file which will contain the HTML for each entry with # fields filled in as ###name###, if you want to insert a field there that you call # name on your "Sign the guestbook page." # ###time### will add the date and time of an entry # #html Setting which tells you if HTML tags are allowed in fields or not. #thanx The html code that contains the thank you page. #page The number of entries per page. ########################################################################################### &parse_form; if ($ENV{'REQUEST_METHOD'} =~ /POST/) { if ($FORM{'save'} == 1) { &getpass; $crypted=crypt(az, $FORM{'pass'}); if ($crypted ne $pass) { print "Content-type:text/plain\n\n"; print "The password you provided is invalid."; print "\nPlease go back to the login page and start over."; exit; } #Save settings. open (SETTINGS, ">$set") || die "Settings file could not be written to"; print SETTINGS "$FORM{'head'}||$FORM{'cent'}||$FORM{'foot'}||$FORM{'temp'}||$FORM{'html'}||$FORM{'thanx'}||$FORM{'page'}||$FORM{'next'}"; close (SETTINGS); print "Content-type:text/html\n\n"; &print_options; } elsif ($FORM{'setpass'} == 1) { if ($FORM{'pass1'} eq $FORM{'pass2'}) { open (SETTINGS, ">$pass_file") || die "Password file could not be opened"; $crypted=crypt(az, $FORM{'pass1'}); print SETTINGS "$crypted"; close (SETTINGS); &reset_files; print "Content-type:text/html\n\n"; &print_login; } else { print "Content-type:text/plain\n\n"; print "Please enter the same passwords in both fields."; } } elsif ($FORM{'checkpass'} == 1) { &getpass; if (crypt(az, $FORM{'pass'}) eq $pass) { print "Content-type:text/html\n\n"; &print_options; } else { print "Content-type:text/plain\n\n"; print "Please press the back button and enter the correct password."; } } elsif ($FORM{'reset'} == 1) { &getpass; $crypted=crypt(az, $FORM{'pass'}); if ($crypted ne $pass) { print "Content-type:text/plain\n\n"; print "The password you provided is invalid."; print "\nPlease go back to the login page and start over."; exit; } &getsettings; open (FILE, ">$cent"); close (FILE); print "Content-type:text/html\n\n"; &print_options; } elsif ($FORM{'default'} ==1) { &getpass; $crypted=crypt(az, $FORM{'pass'}); if ($crypted ne $pass) { print "Content-type:text/plain\n\n"; print "The password you provided is invalid."; print "\nPlease go back to the login page and start over."; exit; } &reset_files; print "Content-type:text/html\n\n"; &print_options; } elsif ($FORM{'edit'} == 1) { &getpass; $crypted=crypt(az, $FORM{'pass'}); if ($crypted ne $pass) { print "Content-type:text/plain\n\n"; print "The password you provided is invalid."; print "\nPlease go back to the login page and start over."; exit; } open (FILE, ">$FORM{'file'}") || die "Couldnt open the edited file"; print FILE $FORM{'text'}; close (FILE); print "Content-type:text/html\n\n"; &print_options; } } elsif ($ENV{'QUERY_STRING'} ne "") { $query=$ENV{'QUERY_STRING'}; &getpass; $crypted=crypt(az, $FORM{'pass'}); if ($crypted ne $pass) { print "Content-type:text/plain\n\n"; print "The password you provided is invalid."; print "\nPlease go back to the login page and start over."; exit; } ($query, $useless)=split(/\&/i, $query); if ($query eq "reset") { print "Content-type:text/html\n\n"; &print_reset; } elsif ($query eq "docs") { print "Content-type:text/html\n\n"; &print_docs; } elsif ($query eq "default") { print "Content-type:text/html\n\n"; &print_default; } elsif ($query =~ /check/) { print "Content-type:text/html\n\n"; &print_options; } elsif ($query =~ /edit/) { print "Content-type:text/html\n\n"; &print_edit; } } elsif (-e "./$pass_file") { print "Content-type: text/html\n\n"; &print_login; } else { print "Content-type: text/html\n\n"; &print_newpass; } exit; sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $buffer=$ENV{QUERY_STRING} if ($ENV{QUERY_STRING}=~/=/); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($FORM{$name}) { $FORM{$name} = $FORM{$name}.",".$value; } else { $FORM{$name} = $value; } } } sub getsettings { open (SETTINGS, "$set") || die "Settings file could not be opened"; @settings=; close (SETTINGS); ($head, $cent, $foot, $temp, $html, $thanx, $page, $next)=split(/\|\|/, "@settings"); } sub getpass { open (PASS, "$pass_file") || die "Password file not found"; @passw=; close (PASS); $pass=$passw[0]; } sub print_options { # Prints out the main file with all the settings loaded in, if they exist open (SETTINGS, "$set") || die "Settings file could not be opened"; @settings=; close (SETTINGS); ($head, $cent, $foot, $temp, $html, $thanx, $page, $next)=split(/\|\|/, "@settings"); print < Nether-Book Options

Nether-Book
Not Just any old guestbook

Documentation | Revert to Default | Reset Guestbook | Upgrade to Proffesional

Header Page Location:

Edit
Footer Page Location: Edit
Middle Page Location: Edit
Template Page Location: Edit
Allow HTML tags in guestbook Entries?
Guestbook Entries Per Page
Next/Previous File Location: Edit
Thank-You Page Location: Edit
A Free Script by Nethernet Inc

HTMLER } sub print_login { print < Nether-Book Login

Nether-Book
Not Just any old guestbook

You Must Login before you can Admin your Nether-Book

Enter an Admin Password:
A Free Script by Nethernet Inc

 

HTMLER } sub print_newpass { print < Nether-Book New User Login

Nether-Book
Not Just any old guestbook

First Time User?

Before Continuing make sure that the directory this program is in is World Writeable (CHMOD 777) And that it has it's own directory like (cgi-bin/guestbook).

If it is CHMOD 777 You can begin the process

Enter an Admin Password:
Confirm Password:
A Free Script by Nethernet Inc

 

HTMLER } sub print_reset { print < Nether-Book Entry Reset

Nether-Book
Not Just any old guestbook

Are you sure you want to Reset the guestbook?
Press the Back button of your browser to return to the previous page and Continue to Clear entries.

 

A Free Script by Nethernet Inc

HTMLER } sub print_docs { print < Nether-Book Documentation

Nether-Book
Not Just any old guestbook

Documentation:


Options list:

  • head The html code that contains the beginning of the page.
  • foot The html code that contains the ending of the page.
  • cent The file where the entries will be appended to.
  • temp - The template file which will contain the HTML for each entry with fields filled in as ###name###, if you want to insert a field there that you call name on your "Sign the guestbook page."
  • html Setting which tells you if HTML tags are allowed in fields or not.
  • thanx The html code that contains the thank you page.
  • page The number of entries per page.
  • next The html code that contains the template for the next and previous buttons (see example code)

    Setting it up:
    When running index.pl for the first time, you will be prompted to enter a password. This will store the encrypted password in the file "password" in the directory that index.pl was stored in.

    After you log in, a set of default files will be created. These files were provided as guides for creating your own.

    The template file contains the format for a generic entry into the guestbook. For each field that you would like to let the signer specify himself or herself, put in a ###field###.

    This is illustrated in the default template, where we leave a field for the name (###name###) and a field for the comments (###comments###). you can create a ###time### field to display the time when the guestbook entry was added

    You may change all of the filenames, but when you change them, make sure that they point to a valid file.

    To edit already existing files (note that you will not be able to create files), click on the edit link right next to each of the filenames.

    The page setting specifies how many entries you would like to be displayed per page. Set this to 0 if you want all of the entries displayed on one page.

    The Previous/Next file specifies the look for the Previous and Next links that will appear if you specify a certain number of entries per page.

    Look in the sample, and you will see . This will be replaced by a link to the previous page with the text Previous in it. The same applies to the next button.

    The HTML setting allows you to restrict people from putting in HTML tags into their input fields. Like that, they will not be allowed to place in pictures, Java applets, ActiveX components, or anything else that requires HTML code.

    Administration:
    If you want to clear the guestbook, click on Reset. This will clear the file that you specified to be as the middle file.

    If you feel like you have messed up, you can click on the Revert to Default link, and this will restore to the original settings.

    For more help mail Support\@nethernet.com

  • A Free Script by Nethernet Inc
    HTMLER } sub print_default { print < Nether-Book Reset to Defaults

    Nether-Book
    Not Just any old guestbook

    Are you sure you want to Revert to Defaults?

    Reverting to default will rest all of the guestbook settings to default as well as overwriting any changes you have made to the headers and footers

    Press the Back button of your browser to return to the previous page and Continue to Revert all entries to Default..

     

    A Free Script by Nethernet Inc

    HTMLER } sub reset_files { open (SETT, ">$set") || die "Couldnt open the settings file"; print SETT "head.html\|\|cent.html\|\|foot.html\|\|template\|\|\|\|thanx.html\|\|0||prevnext.html"; close (SETT); open (HEAD, ">head.html") || die "Couldnt open the header file"; print HEAD < Nether-Book
    HEADERS close (HEAD); open (CENT, ">cent.html") || die "Cant open the center file"; close (CENT); open (FOOT, ">foot.html") || die "Couldnt open the footer file"; print FOOT <

    Nether-Book
    Not Just any old guestbook

    A Free Script by Nethernet Inc
    FOOTERS close (FOOT); open (TEMP, ">template") || die "Couldnt open the template file"; print TEMP <

    Time: ###time###
    Name: ###name###
    Comments: ###comments###
    TEMPERS close (TEMP); open (THANX, ">thanx.html") || die "Couldnt open the thank you file"; print THANX < Nether-Book

    Nether-Book
    Not Just any old guestbook

    Thank you for signing in our guestbook. View the guestbook

    A Free Script by Nethernet Inc
    THNX close (THANX); open (PREV, ">prevnext.html"); print PREV <

    HTMLER close (PREV); } sub print_edit { &getsettings; $file=$head if ($FORM{'edit'} eq "header"); $file=$foot if ($FORM{'edit'} eq "footer"); $file=$cent if ($FORM{'edit'} eq "center"); $file=$thanx if ($FORM{'edit'} eq "thanx"); $file=$temp if ($FORM{'edit'} eq "template"); $file=$next if ($FORM{'edit'} eq "prevnext"); open (FILE, "$file") || die "File not found."; @files=; $files="@files"; print < Nether-Book

    Nether-Book
    Not Just any old guestbook

    Editing : $file

    A Free Script by Nethernet Inc

    HTMLER }

    #!/usr/bin/perl # # Copyright 1999 Ilia Mirkin / Nethernet. # Some minor modifications Copyright Ben Congleton / Nethernet # # # If you use this script mail ben@nethernet.com and we will add a link to your # site as an example of what Nether-Book can do :-) $set="options"; #File where options are stored. Has to be chmodded to 777. &parse_form; if ($ENV{'REQUEST_METHOD'} =~ /POST/i) { if (-e $set) { print "Content-type:text/html\n\n"; open (SETTINGS, $set) || die "Settings file could not be opened"; @xx=; close (SETTINGS); $x="@xx"; ($head, $cent, $foot, $temp, $html, $thanx, $page, $next)=split(/\|\|/, $x); open (TEMPLATE, $temp) || die "Template file could not be opened"; @template=