Helo everyone
My php code
<?php
if ($page == "Muzika")
{ $terms_failas = "./muzika_terms.txt";
}
elseif ($page=="Filmai")
{ $terms_failas = "./filmai_terms.txt";
}
elseif ($page=="Torentai")
{
$terms_failas = "./torentai_terms.txt";
}
if (isset($_GET['q'])) {
$terms = $_GET['q'];
$data = "$terms\n";
$fh = fopen($terms_failas,'a');
fwrite($fh, $data);
fclose($fh);
}
if ($page == "Muzika")
{ $f = "./muzika_terms.txt";
}
elseif ($page=="Filmai")
{ $f = "./filmai_terms.txt";
}
elseif ($page=="Torentai")
{
$f = "./torentai_terms.txt";
}
$size = filesize($f);
$fH = fopen($f,"r");
$data = fread($fH, $size);
fclose($fH);
?>
Its so simple but its write twice. i cant understand why.
this script i have wrote after, but I still getting double results...
<?php
$terms_failass = "terms.txt";
$data = "labuukas";
$fh = fopen($terms_failass,'a');
fwrite($fh, $data);
fclose($fh);
?>
Any ideas?