#!/usr/local/bin/perl if ($ENV{REQUEST_METHOD} eq "GET") { $data=$ENV{QUERY_STRING}; } elsif ($ENV{REQUEST_METHOD} eq "POST") { for ($i=0;$i<$ENV{CONTENT_LENGTH};$i++) { $data .=getc; } } @data=split(/&/, $data); if ($#data > 1) { $ok = 0; foreach $item (0..5) { $data[$item] = substr($data[$item], index($data[$item], '=') + 1); $data[$item] =~ s/\+/ /g; $data[$item] =~ s/%(..)/pack("c",hex($1))/ge; } if (($data[0] ne '') && ($data[1] ne '') && ($data[2] ne '') && ($data[5] ne '')) { open(OUT, ">> guestbook"); print(OUT join('&', @data), "\n"); close(OUT); } } print(< Guestbook

Guestbook

Add Yourself:

Your name

The town where you live

The country where you live

Your email address, if you have one

Your web page, if you have one

Your favourite game show

The Guestbook

BACK_TO_PERL open(IN, "/u4/uzke/kebl0110/cgi/out/guestbook"); if ($ENV{HTTP_USER_AGENT} =~ /ozilla/) { print("\n"); while ($line = ) { chop($line); @line = split('&', $line); print("\n"); } print("
NameTownCountryEmailWWWFavourite Game Show
$line[0]$line[1]$line[2]"); if ($line[3] ne '') { print("email"); } print(""); if ($line[4] ne '') { print("WWW"); } print("$line[5]
\n"); } else { while ($line = ) { chop($line); @line = split('&', $line); print("Name: $line[0]"); if ($line[3] ne '') { print(" [ email ]"); } if ($line[4] ne '') { print(" [ WWW ]"); } print("
\nLives in $line[1], $line[2]
\nFave Game Show: $line[5]

\n"); } } close(IN); print(< With many thanks to Mark Rigby-Jones for knowing more interesting things than me.
Back to The UK Game Show Page BACK_TO_PERL