Example #1
0
                $clientProxy = new OpXML('clientProxy', $fpath);
                /*
                // safephp一次,过滤XSS
                $qstr = urldecode($_POST['anehtaInput_anehtaPostClientProxy']);
                $qstr = $parser->parse($qstr);
                $parser->clear();    
                
                // 重新编码$qstr
                $qstr = urlencode($qstr);
                */
                $qstr = htmlentities($_POST['anehtaInput_anehtaPostClientProxy']);
                //echo $qstr;
                //增加记录
                $arr = array('pageContent' => "\r\n<![CDATA[\r\n" . $qstr . "\r\n]]>\r\n");
                if ($clientProxy->getRecordById(1)) {
                    $clientProxy->updateRecordById(1, $arr);
                } else {
                    $clientProxy->insert($arr);
                }
                exit;
            }
        }
    }
}
/*******************************************************
* 解码并去除[NoCryptMark]
********************************************************/
// 使用strpos 而不是 strchr ,因为更快,消耗内存更小
if (strpos($qstr, "NoCryptMark") === false) {
    $qstr = base64_decode($qstr);
    // 解码base64
Example #2
0
     $boomerangsrc = $_POST['boomerangsrc'];
 }
 $fpath = 'config.xml';
 //文件的路径,不用手动创建文件
 if (file_exists($fpath) == false) {
     //配置文件不存在就生成一个
     $anehtaConfig = new OpXML('anehtaConfig', $fpath);
     //增加一条记录
     $arr = array('homepage' => 'http://anehta.googlecode.com', 'author' => 'axis', 'blog' => 'http://hi.baidu.com/aullik5', 'team' => 'http://www.ph4nt0m.org');
     $anehtaConfig->insert($arr);
 } else {
     //配置文件存在,开始更新记录
     $anehtaConfig = new OpXML('anehtaConfig', $fpath);
     //增加一条记录
     $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);
     }
 }