Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Create swishmax hitcounter
Category : SWiSHMax | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

1.create a dynamic textbox name it "_counter" and set its variable as "counter" and put following script on frist frame of the movie or combine all within as sprite

CODE
onLoad() {
   this.loadVariables("counter.php");
   stop();
}



2.create empty counter.txt and save it
3.now create counter.php file and put following PHP code in it

CODE
<?

$filename="counter.txt";
if(!(@chmod($filename,0600)))
    report("Cannot write to file - $filename");

$counts=intval(loadfile($filename));
$counts++;
if(savefile($filename,$counts))
    report("$counts");
else
    report("Cannot write to file - $filename");


function savefile($fname,$data) {
     if(!file_exists($fname))
          report("File nout found - $fname");
     $f=fopen($fname,"w");
     fwrite($f,$data);
     fclose($f);
     return true;
}
function loadfile($fname) {
     if(!file_exists($fname))
          report("File nout found - $fname");
     $f=fopen($fname,"r");
     $data=fread($f,filesize($fname));
     fclose($f);
     return $data;
}

function report($msg) {
     die("&counter=$msg&");
}

?>



export your movie upload and test


All rights reserved - swish-db.com