#!/usr/pkg/bin/php "") { // Build the signature / message to save in the file $remoteIp = getenv("REMOTE_ADDR"); $message[] = $ascLine; $message[] = $inputString; //$message[] = " From: ".$remoteIp.", ".date("D M j G:i:s T Y"); $message[] = " ".date("D M j G:i:s T Y"); $message[] = $ascLine; // Write to the guestbook, prepend file_put_contents($guestBookFile,implode("\n",$message)); // If there were previous entries, we'll add them after this new one if(isset($bookLine)) { file_put_contents($guestBookFile,implode($bookLine),FILE_APPEND | LOCK_EX); } } // Display guest book contents if(isset($message)) { foreach($message as $bookLineText) { echo "i".$bookLineText.$terminate; } } echo "i".$terminate; $count=0; if(isset($bookLine)) { foreach($bookLine as $bookLineText) { $count++; // 5 lines in the text file per entry, use modulus to insert a gopher menu item ever n items (x5) // so scrolling works for long guestbooks if($count%15==0) { echo "1Scroll Down\t/guestBook.php\t$serverUrl\t70".$terminate; } echo "i".rtrim($bookLineText).$terminate; } } // Link to the source //echo "i".$ascLine.$terminate; echo "0View the PHP source for the guestbook\t/guestBook.txt\tgopher.jozhaus.com\t70".$terminate; include("/var/gopher/footer.php"); ?>