<?php
/*
* Created on 2011-4-16
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$guestbook=new DomDocument();
$guestbook->load('count.xml');
$threds=$guestbook->documentElement;
$table=$guestbook->createElement('table');
$threds->appendChild($table);
$title=$guestbook->createElement('title');
$title->appendChild($guestbook->createTextNode($_POST['title']));
$table->appendChild($title);
$count=$guestbook->createElement('count');
$count->appendChild($guestbook->createTextNode($_POST['count']));
$table->appendChild($count);
$time=$guestbook->createElement('time');
$time->appendChild($guestbook->createTextNode(date('Y-m-d H:i:s')));
$table->appendChild($time);
$fp=fopen('count.xml','w');
if(fwrite($fp,$guestbook->saveXML())){
echo '留言成功!';
echo "<script>setTimeout(function(){location.href='http://blog.163.com/kefan_1987/blog/index.php';},2000);</script>";
}else{
echo '留言失败!';
}
fclose($fp);
?>
/*
* Created on 2011-4-16
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$guestbook=new DomDocument();
$guestbook->load('count.xml');
$threds=$guestbook->documentElement;
$table=$guestbook->createElement('table');
$threds->appendChild($table);
$title=$guestbook->createElement('title');
$title->appendChild($guestbook->createTextNode($_POST['title']));
$table->appendChild($title);
$count=$guestbook->createElement('count');
$count->appendChild($guestbook->createTextNode($_POST['count']));
$table->appendChild($count);
$time=$guestbook->createElement('time');
$time->appendChild($guestbook->createTextNode(date('Y-m-d H:i:s')));
$table->appendChild($time);
$fp=fopen('count.xml','w');
if(fwrite($fp,$guestbook->saveXML())){
echo '留言成功!';
echo "<script>setTimeout(function(){location.href='http://blog.163.com/kefan_1987/blog/index.php';},2000);</script>";
}else{
echo '留言失败!';
}
fclose($fp);
?>