<?php session_start(); if($user ==! $mat){ $_SESSION['name']= $user;
}else{ require_once(index.php); echo 'no mat'; }
$user = $_POST['user']; $text = $_POST['text'];
class shout{ private $block=false; public $mat = array('0'=>'pizdez', '1'=>'xui','2'=>'pizda'); public function addmassage($text,$user,$fp,$block,$mat){ if (array_search($text, $mat)){ $block = true; echo 'No Mat Please'; }else if($text == '' || $user= ''){ echo 'please type a text in and your name'; }else { $fp = fopen('shout.txt' , 'r+'); fwrite($fp,'<tr><td>'. $user .'</td></tr><tr><td>'. $text .'</td></tr>'); fclose($fp); read($data, $rfp,$i,$c); } } public function block($block){ if ($block = true){ echo 'sory! you are blocked'; }else{ $addmassage($text,$user,$fp,$block,$mat); } }public function read($data, $rfp,$i,$c){ for($i=0,$c=count($data);$i<$c;$i++){ echo $i; } $rfp = fopen('shout.txt' , 'r+'); $data = file ('shout.txt'); fclose($rfp); echo $data[$i]; block($block,$addmassage,$text,$user,$fp,$block,$mat); read($data, $rfp,$i,$c); } }
block($block,$addmassage,$text,$user,$fp,$block,$mat); read($data, $rfp,$i,$c);
|