Login form



Operations with file content- data in table, search data, PART 8
function f_atvaizdavimas(){

global $failas;
?><a href="/index.php?rasymas=1">Irasyti</a><br>

<form action=index.php>
<input type=text name=search value="<? echo $_GET['search'] ; ?>">
<input type=submit value=spausk>
</form>

<?

$f    = fopen($failas,"r");
$x     = 'bgcolor="#AAAAAA"';
$y     = 'bgcolor="#FFFFFF"';
$search =  $_GET['search'];


echo "<table width=50% border=1><tr><th>&nbsp;</th><th>vardas</th><th>nikas</th><th>pranesimas</th></tr>";

if (filesize($failas)>0){
while (!feof ($f)) {
$i++;
$tr_spec = ($i % 2) ? $x : $y;
$string = fgets ($f,1000);
$part = explode ( "|" , $string );


if ( @stristr($part[2] , $search) == false and $search) continue ;

echo "<tr $tr_spec ><td><a href = \"index.php?rasymas=2&id=$i\">Trinti</a></td><td>" . $part[0] . "</td><td>". $part[1]." </td><td>". $part[2] ."</td></tr>";

}
}
fclose ($f);
echo "</table>";

}//f_atvaizdavimas()
 
[ BBC news ][ Yahoo news ][ Linux guru ][ Webmaster ACE ]