Location: PHPKode > projects > HuskyMail Webmail > contacts/restore.php
<?php
require_once("../contacts/backup.php");
$contacts = array();
$handle = opendir($bookdir);
$skip = array(".","..","index.php","backups","thumbs.db","desktop.ini",".DS_Store","_notes");
while($file = readdir($handle)) {
	if (!in_array($file,$skip)) { array_push($contacts,$file); }}
if (count($contacts) > 0) {
	foreach ($contacts as $k) { unlink($bookdir.$k); }}
$content = file_get_contents($bookdir."backups/".$_GET['restore']);
$content = $foo->decode($content,$default_key);
$parts = explode("===",$content);
foreach ($parts as $p) {
	$bits = explode("+++",$p);
	touch($bookdir.$bits[0].".php");
	file_put_contents($bookdir.$bits[0].".php",$bits[1]); }
header("Location: ./contacts.php");
?>
Return current item: HuskyMail Webmail