Jump to content
php.lv forumi

cik cilvēki ir lapā


spermer_co

Recommended Posts

atradu nopostošu, jo ganjau nesmu vienigais kam vaiga :P

<?
session_start();
session_set_cookie_params('0');
$id = session_id();
$CurrentTime = time();
$LastTime = time() - 120;
$base = "base.txt"; 
$file = file($base);
$k = 0;
for ($i = 0; $i < sizeof($file); $i++) {
   $line = explode("|", $file[$i]);
   if ($line[1] > $LastTime) {
		$ResFile[$k] = $file[$i];
		$k++;
   }
}

for ($i = 0; $i<sizeof($ResFile); $i++) {
 $line = explode("|", $ResFile[$i]);
 if ($line[0]==$id) {
	 $line[1] = trim($CurrentTime)."\n";
	 $is_sid_in_file = 1;
 }
 $line = implode("|", $line);
 $ResFile[$i] = $line;
}

$fp = fopen($base, "w");
for ($i = 0; $i<sizeof($ResFile); $i++) {
fputs($fp, $ResFile[$i]);
}
fclose($fp); 
if (!$is_sid_in_file) {
$fp = fopen($base, "a-");
$line = $id."|".$CurrentTime."\n";
fputs($fp, $line);
fclose($fp);
}
$file = file($base);
echo sizeof($file);
?>

ta vel ir jaizveido fails base.txt tur nekas naw jaliek iekshaa to pats skripts izdaris kas jadar :) nav vaidziigs mysql ka redzat

Link to comment
Share on other sites

taatad tas noziimee kad es to nevaru izdariit ja un visur kur pieprasa to CHMOD, tad tas man neies???es tik maaku html maajas lapu izvedot, vienreiz nokacaaju templatu php un tur ir tikai skripti un skripit.....un no tiem man nav nekaadas sajeegas....

Edited by satek
Link to comment
Share on other sites

kompilātora rezultāts ir kaut kas kā izpildāma programmiņa

Ne vienmeer - tas var buut arii Objekts, biblioteka (dll) utt

galvena atskjiriiba ir taa ka peec kompelaacijas pats kompelaators vairs nav vajadziigs - faktiski prograamas koda parveershana mashiinkodaa....

Link to comment
Share on other sites

×
×
  • Create New...