آمار بازدید در swish

jvaad_p84

Member
سلام دوستان کسی میدونه کجای این فایل ها مشکل داره که آمار بازدیدکننده ها رو درست نمایش نمیده؟

فایل ها رو پیوست کردم ممنون میشم کمک کنید!!!!!!!!!!!!!!!!!!!:sad:
 

پیوست ها

  • stut-96_chasecounter.zip
    7.3 کیلوبایت · بازدیدها: 4

Amiru60

Member
با سلام. الولا فایل PHP که به کار بردین مشکل داره و کار نمیکنه.
دوما این فایل PHP مخصوص وبه نه فلش.
شما باید اوا با فلش مقدار فایل count.txt را بگیرید. بعد به PHP پست کنید. وبعد از اظافه کردن 1 روی فایل count.txt و نتیجه دوباره در فلش نمایش داده بشه.
 

zxcv900

Member
نیاز به این همه دردسر نیست !
شما باید فایل php خودت رو به این شکل تغییر بدیو به راحتی مشکلت حل میشه من خودم فایلتو تست کردم
برات فایل درست شده رو پیوست کردم هم فایل تکستت مشکل املایی داشت هم فایل پی اچ پیت
PHP:
<?php
$filename = "count.txt";
$file = fopen( $filename, 'r' ); //We are only reading from the file this time, thus the r instead of w
$lines = file($filename);
/*  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get's the data from the file. http://www.php.net/file. It seperates
the data into an array, which I will access in the next line.
*/ 
$count = $lines[0]; 
/* ^^^^^^^^^^^^^^^^^^^^^^^^
We are now getting the data from the array so we can use it in the script
*/
$c = ereg_replace('&counter=','',$count); // این تابع رو باید استفاده کنی تا مقدار متغیر قبلی رو بدست بیاری

$c++;

$count = "&counter=".$c;
echo $count;
// Adding one to the count, because we are counting each visit, and if this is loaded
// that means there is a new visitor to add :)


fclose( $file ); //Closing the file

$file = fopen($filename, "w" ); //Now we are gonna re-write the file with the new count of visitors

fwrite( $file, $count );

fclose( $file );

?>
 

پیوست ها

  • count.txt
    10 بایت · بازدیدها: 5
  • count.zip
    675 بایت · بازدیدها: 6
آخرین ویرایش:

جدیدترین ارسال ها

بالا