Hello,
I have the following guestbook, that works great - except new entries in the book are added to the bottom of the page, and I would like to change the script so that new entries are displayed at the top of the page. Any and all help with this is greatly appreciated!
TIA!
-Jim
---Begin Guestbook Code---
use CGI;
$co = new CGI;
open (BOOK, "+<book.htm"
or die "Could not open guest book.";
seek (BOOK, -length($co->end_html), 2);
$date= localtime;
$username = $co->param('username');
$username =~ s/</</g;
$text = $co->param('comments');
$text =~ s/</</g;
print BOOK
$co->h3
("Posted by ", $username, " on ", $date,
$co->p,
$text,
),
$co->hr,
$co->end_html;
close BOOK;
print $co->header,
$co->start_html
( -title=>'Guest Book',
-BGCOLOR=>'black',
-Link=>'red',
-text=>'white'
);
print
$co->center
( $co->h2('Thanks for adding to the Guest Book!')
),
"To view the Guest Book, ",
$co->a
(
{href=>"book.htm"},
"click here"
),
".",
$co->hr,
$co->end_html;
---End Guestbook Code---
I have the following guestbook, that works great - except new entries in the book are added to the bottom of the page, and I would like to change the script so that new entries are displayed at the top of the page. Any and all help with this is greatly appreciated!
TIA!
-Jim
---Begin Guestbook Code---
use CGI;
$co = new CGI;
open (BOOK, "+<book.htm"
or die "Could not open guest book.";
seek (BOOK, -length($co->end_html), 2);
$date= localtime;
$username = $co->param('username');
$username =~ s/</</g;
$text = $co->param('comments');
$text =~ s/</</g;
print BOOK
$co->h3
("Posted by ", $username, " on ", $date,
$co->p,
$text,
),
$co->hr,
$co->end_html;
close BOOK;
print $co->header,
$co->start_html
( -title=>'Guest Book',
-BGCOLOR=>'black',
-Link=>'red',
-text=>'white'
);
$co->center
( $co->h2('Thanks for adding to the Guest Book!')
),
"To view the Guest Book, ",
$co->a
(
{href=>"book.htm"},
"click here"
),
".",
$co->hr,
$co->end_html;
---End Guestbook Code---