Chulalongkorn University
Language Institute
Home I News I Links I Contact us
English Corner

"Archive"

"; } // 2. Read Counter from File $file = fopen("counter.txt", "r"); $counter = fread($file, filesize("counter.txt")); fclose($file); if (!isset($_COOKIE["is_visit"])) { // 3. Increase Counter $counter++; // 4. Write Counter back to File $file = fopen("counter.txt", "w"); fwrite($file, $counter); fclose($file); setcookie("is_visit", "yes", time()+8); } // 5. Show Counter echo "
"; for ($i = 0; $i < strlen($counter); $i++) { $no = substr($counter, $i, 1); echo ""; } ?>