Subject: [LINUX:12122] Re: text counter
From: Andreas Mueller (amu@tr.debian.net)
Date: Wed 12 Jan 2000 - 14:20:44 EET
On Tue, Jan 11, 2000 at 10:27:14PM +0200, Baris Ozyurt wrote:
> Selam,
>
> apache cgi-bin dizininideki bir text counter cgi scriptinin baska bir server
> , ornegin NT uzerindeki bir sayfada gorunmesini ve saymasini saglayabilir
> miyiz? sayfa html ya da shtml olabilir.
>
> nasil yapilacagini bilen var mi? ya da nt icin baska bir text counter bilen?
>
counter.php3
<?
$pathname = "/secret/topsecret/fyeo"; //directory where counter files will be stored
$filename = sprintf("%s%s", $pathname, $countername);
if (file_exists($filename))
{
$fp=fopen($filename,"r");
if ($fp == 0)
{
print "Error opening file";
}
$count=fgets($fp,4096);
$lastip=fgets($fp,4096);
fclose($fp);
}
else
{
$count=0;
$lastip=0;
}
if ($lastip != $REMOTE_ADDR)
{
$count = $count + 1;
$fp1=fopen($filename,"w");
fputs($fp1,$count);
fputs($fp1,"\n");
fputs($fp1,$REMOTE_ADDR);
fclose($fp1);
}
print "C: $count"; // Customize presented message here
?>
------------------------------
index.php3
<?php
$countername = somedescriptivename.counter;
require("/secret/topsecret/fyeo/code/counter.php3");
?>
>
> baris.
>
>
> Listeden cikmak icin:
> unsub linux
> mesajini listeci@bilkent.edu.tr'a gonderiniz.
> Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
> Liste arsivinin adresi: http://listweb.bilkent.edu.tr/
-- MCSE = Must Call Somebody Else --------------------------------------------------------------------- Andreas Mueller amu@linux.de amu@bimel.com.tr Bilgisayar M\xfchendisi http://www.tr.debian.net Bimel Limited Tel: +90 (312) 434 2245 Bayindir Sokak 5/5 Fax: +90 (312) 431 1953 Yenisehir 06410 Ankara - TURKEY Private: +90(542)611 2976 ---------------------------------------------------------------------- Key fingerprint = EF5E 33B2 13E5 9257 D42C 671C 6979 588D 9EF0 2E92 Listeden cikmak icin: unsub linux mesajini listeci@bilkent.edu.tr'a gonderiniz. Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin. Liste arsivinin adresi: http://listweb.bilkent.edu.tr/