编辑问题 P
", "", $description);
$description = str_replace("", "
", $description); $description = str_replace(",", ",", $description); $input=$_POST['input']; $input = str_replace("
", $input); $input = str_replace(",", ",", $input); $output=$_POST['output']; $output = str_replace("
", $output); $output = str_replace(",", ",", $output); $sample_input=$_POST['sample_input']; $sample_output=$_POST['sample_output']; $hint=$_POST['hint']; $hint = str_replace("
", $hint); $hint = str_replace(",", ",", $hint); $source=$_POST['source']; $spj=$_POST['spj']; if(false){ $title = stripslashes($title); $time_limit = stripslashes($time_limit); $memory_limit = stripslashes($memory_limit); $description = stripslashes($description); $input = stripslashes($input); $output = stripslashes($output); $sample_input = stripslashes($sample_input); $sample_output = stripslashes($sample_output); //$test_input = stripslashes($test_input); //$test_output = stripslashes($test_output); $hint = stripslashes($hint); $source = stripslashes($source); $spj = stripslashes($spj); $source = stripslashes($source); } $title=($title); $description=RemoveXSS($description); $input=RemoveXSS($input); $output=RemoveXSS($output); $hint=RemoveXSS($hint); $basedir=$OJ_DATA."/$id"; echo "样例数据文件已经更新!!
"; if($sample_input&&file_exists($basedir."/sample.in")){ //mkdir($basedir); $fp=fopen($basedir."/sample.in","w"); fputs($fp,preg_replace("(\r\n)","\n",$sample_input)); fclose($fp); $fp=fopen($basedir."/sample.out","w"); fputs($fp,preg_replace("(\r\n)","\n",$sample_output)); fclose($fp); } $spj=intval($spj); $sql="UPDATE `problem` set `title`=?,`time_limit`=?,`memory_limit`=?, `description`=?,`input`=?,`output`=?,`sample_input`=?,`sample_output`=?,`hint`=?,`source`=?,`spj`=?,`in_date`=NOW() WHERE `problem_id`=?"; pdo_query($sql,$title,$time_limit,$memory_limit,$description,$input,$output,$sample_input,$sample_output,$hint,$source,$spj,$id) ; echo "编辑成功!"; echo "查看问题"; } ?>
", $description); $description = str_replace(",", ",", $description); $input=$_POST['input']; $input = str_replace("
", "", $input); $input = str_replace("
", "", $input); $input = str_replace(",", ",", $input); $output=$_POST['output']; $output = str_replace("
", "", $output); $output = str_replace("
", "", $output); $output = str_replace(",", ",", $output); $sample_input=$_POST['sample_input']; $sample_output=$_POST['sample_output']; $hint=$_POST['hint']; $hint = str_replace("
", "", $hint); $hint = str_replace("
", "", $hint); $hint = str_replace(",", ",", $hint); $source=$_POST['source']; $spj=$_POST['spj']; if(false){ $title = stripslashes($title); $time_limit = stripslashes($time_limit); $memory_limit = stripslashes($memory_limit); $description = stripslashes($description); $input = stripslashes($input); $output = stripslashes($output); $sample_input = stripslashes($sample_input); $sample_output = stripslashes($sample_output); //$test_input = stripslashes($test_input); //$test_output = stripslashes($test_output); $hint = stripslashes($hint); $source = stripslashes($source); $spj = stripslashes($spj); $source = stripslashes($source); } $title=($title); $description=RemoveXSS($description); $input=RemoveXSS($input); $output=RemoveXSS($output); $hint=RemoveXSS($hint); $basedir=$OJ_DATA."/$id"; echo "样例数据文件已经更新!!
"; if($sample_input&&file_exists($basedir."/sample.in")){ //mkdir($basedir); $fp=fopen($basedir."/sample.in","w"); fputs($fp,preg_replace("(\r\n)","\n",$sample_input)); fclose($fp); $fp=fopen($basedir."/sample.out","w"); fputs($fp,preg_replace("(\r\n)","\n",$sample_output)); fclose($fp); } $spj=intval($spj); $sql="UPDATE `problem` set `title`=?,`time_limit`=?,`memory_limit`=?, `description`=?,`input`=?,`output`=?,`sample_input`=?,`sample_output`=?,`hint`=?,`source`=?,`spj`=?,`in_date`=NOW() WHERE `problem_id`=?"; pdo_query($sql,$title,$time_limit,$memory_limit,$description,$input,$output,$sample_input,$sample_output,$hint,$source,$spj,$id) ; echo "编辑成功!"; echo "查看问题"; } ?>