Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. catch (PDOException $e) {
  2.             if(!file_exists('countError.txt')) {
  3.                 $countErrorFile = fopen('countError.txt', 'w');
  4.                 fwrite($countErrorFile, 1);
  5.                 $fp = fopen('error.txt', 'w');
  6.                 fwrite($fp, 'Count bad requests ');
  7.                 fwrite($fp, 1);
  8.                 fwrite($fp, '. Error = ');
  9.                 fwrite($fp, $e->getMessage());
  10.             }
  11.            
  12.             else {
  13.                 $readCountError = file_get_contents('countError.txt', NULL, NULL, 0);
  14.                 $countErrorFile = fopen('countError.txt', 'w');
  15.                 fwrite($countErrorFile, $readCountError + 1);
  16.                
  17.                 $fp = fopen('error.txt', 'w');
  18.                 fwrite($fp, 'Count bad requests ');
  19.                 fwrite($fp, $readCountError + 1);
  20.                 fwrite($fp, '. Error = ');
  21.                 fwrite($fp, $e->getMessage());
  22.             }
  23.        
  24.             die('<p>Произошла ошибка.</p>');
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement