Guestbook Admin Interface



Non Numeric ID Number."; echo "

 

"; echo "

"; echo "

"; echo " Admin Main -"; echo " Logout"; echo "

"; echo ""; echo ""; exit; } if (!($order == "asc" || $order == "desc" || $order == "")) { echo "Entry order can only be 'asc' or 'desc'"; echo "

 

"; echo "

"; echo "

"; echo " Admin Main -"; echo " Logout"; echo "

"; echo ""; echo ""; exit; } // Reading in all the records, putting each guestbook entry in one Array Element ----- $filename = "../data/list.txt"; $handle = fopen($filename, "r"); $datain = fread($handle, filesize($filename)); fclose($handle); $out = explode("", $datain); $outCount = count($out) - 1; $j = $outCount-1; if ($order == "desc") { for ($i=0; $i<=$outCount; $i++) { $lines[$j] = unserialize($out[$i]); $j = $j - 1; } } else { for ($i=0; $i<=$outCount; $i++) { $lines[$i] = unserialize($out[$i]); } } // Lets Clear the output text file first @ $fp = fopen("../data/list.txt","w"); flock($fp, 2); fwrite($fp, ""); flock($fp, 3); fclose($fp); // Now that we have all the entries in an array, lets take out the one entry that the user wants deleted for ($i=0; $i<$outCount; $i++) { if ($i != $id) { @ $fp = fopen("../data/list.txt","a"); flock($fp, 2); $data = serialize($lines[$i]).""; fwrite($fp, $data); flock($fp, 3); fclose($fp); } } //$URL="delete.php"; //header ("Location: $URL"); ?>
Message Deleted!


Back to Delete Menu

 

Admin Main - Logout