Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. set_time_limit(1);
  3.  
  4. $find=array('cipa','chuj','kurwa');
  5. $replace=array('wagina','penis','prostytutka');
  6.  
  7. if(isset($_POST['plik'])&&!empty($_POST['plik'])){
  8. $x=$_POST['plik'];
  9. $text= file_get_contents($x);
  10. $text_new= str_ireplace($find, $replace, $text);
  11.  
  12. $y=1;
  13.  
  14. while(file_exists("uploads/plik".$y.".txt")){
  15. $y++;
  16. }
  17. $name="plik".$y.".txt";
  18. $myfile = fopen("uploads/$name", "w");
  19. $file=fwrite($myfile,$text_new);
  20.  
  21. if($file){
  22. echo "file loaded succesfully";
  23. }
  24. else{
  25. echo "error loading the file";
  26. }
  27. }
  28. ?>
  29.  
  30. <form action="file.php" method="post">
  31. <input type="file" name="plik">
  32. <input type="submit">
  33. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement