Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!isset($_GET['action']))
- {
- $error = "";
- if ( isset($_GET["message"]) && !empty($_GET["message"])) $message = $_GET["message"];else $error .= "Помилка 1";
- if ( isset($_GET["link"]) && !empty($_GET["link"])) $link = $_GET["link"];else $error .= "Помилка 2";
- if ( !empty($error) ) echo("".$error."");
- else // записываем в файл
- {
- // вычисляем номер последней записи
- $file = file("./data/broken.csv");
- $max = 0;
- foreach( $file as $line)
- {
- if ( !empty($line) )
- {
- $elem = explode("<|>",$line);
- if ( $elem[0] > $max) $max = $elem[0];
- }
- }
- $max++;
- if (is_writeable("./data/broken.csv"))
- {
- $month = array('1' => 'января','2' => 'февраля','3' => 'марта','4' => 'апреля','5' => 'мая','6' => 'июня','7' => 'июля','8' => 'августа','9' => 'сентября','10' => 'октября','11' => 'ноября','12' => 'декабря');
- $d = date("d {$month[date("n")]} Y, в H:i");
- $f = fopen("./data/broken.csv","a+");
- $write_text = "$max<|>$d<|>$message<|>$link rn";
- fputs($f,$write_text);
- fclose($f);
Add Comment
Please, Sign In to add comment