| |
 
//Name of file used to store your entry, change it if necessary $data_file = "ardgb18.dat"; //Maximum entry stored in data file $max_record_in_data_file = 300; //Maximum entries allowed per session, to prevent multiple entries made by one visitor $max_entry_per_session = 2; //Enable Image verification code, set the value to NO if your web server doesn't support GD lib $imgcode = "NO"; //Color & font setting $background = "#000000"; $table_top = "#D3B68E"; $table_content_1a = "#EDEEE8"; $table_content_1b = "#E4E4E4"; $table_content_2a = "#FFF8F0"; $table_content_2b = "#FFEFDF"; $table_bottom = "#D3B68E"; $table_border = "#000000"; $title_color = "#FFFF00"; $link = "#0000FF"; $visited_link = "#0000FF"; $active_link = "#FF0000"; $font_face = "verdana"; $message_font_face = "arial"; $message_font_size = "2"; //-- Don't change bellow this line unless you know what you're doing $do = isset($_REQUEST['do']) ? trim($_REQUEST['do']) : ""; $id = isset($_GET['id']) ? trim($_GET['id']) : ""; $page = isset($_GET['page']) ? $_GET['page'] : 1; $self = $_SERVER['PHP_SELF']; if (!file_exists($data_file)) { echo "Error !! Can't find data file : $data_file.
"; exit; } else { if ($max_record_in_data_file != "0") { $f = file($data_file); rsort($f); $j = count($f); if ($j > $max_record_in_data_file) { $rf = fopen($data_file,"w"); if (strtoupper($os) == "UNIX") { if (flock($rf,LOCK_EX)) { for ($i=0; $i<$max_record_in_data_file; $i++) { fwrite($rf,$f[$i]); } flock($rf,LOCK_UN); } } else { for ($i=0; $i<$max_record_in_data_file; $i++) { fwrite($rf,$f[$i]); } } fclose($rf); } } } session_start(); $newline = (strtoupper($os) == "WIN") ? "\r\n" : "\n"; switch ($do) { case "": $record = file($data_file); rsort($record); $jmlrec = count($record); ?>