Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with guestbook needed

Status
Not open for further replies.

yim11

MIS
Jun 26, 2000
35
0
0
US
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, &quot;+<book.htm&quot;)
or die &quot;Could not open guest book.&quot;;

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
(&quot;Posted by &quot;, $username, &quot; on &quot;, $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!')
),
&quot;To view the Guest Book, &quot;,
$co->a
(
{href=>&quot;book.htm&quot;},
&quot;click here&quot;
),
&quot;.&quot;,
$co->hr,
$co->end_html;
---End Guestbook Code---
 
you should add a comment above the post, then, when you open the file, search for the comment you made and replace it with a new comment and post. adam@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top