Advertisement
Java_Volume1 Miscellaneous #102793

Text Counter

This code will take a file, who has been initialized by putting 0 in the file and will increment it and display it on a page.

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
<?php
if ($do == "") {
	$counterFile="counter.txt"; 
	$fp= fopen($counterFile,r);
	$num= fgets($fp,5);
	$num +=1; 
	$suc=fclose($fp);
	print "<font face=verdana,sans-serif size=1><b>$num</b></font>"; 
	$fp=fopen($counterFile,w);
	$suc=fputs($fp, $num); 
	$suc=fclose ($fp); 
} else {
	$counterFile="counter.txt"; 
	$fp= fopen($counterFile,r);
	$num= fgets($fp,5);
    print "<font face=verdana,sans-serif size=1><b>$num</b></font>"; 
	$suc=fclose ($fp); 
 }
?>
Původní komentáře (3)
Obnoveno z Wayback Machine