nightscream
New Member
- Messages
- 948
- Reaction score
- 0
- Points
- 0
Can someone tell me what's wrong with this code, this is a counter it files 3 counts in one file
begin file looks like 0||0||0 but it won't increase when i click a link then it will become ||
begin file looks like 0||0||0 but it won't increase when i click a link then it will become ||
PHP:
<?php
$fileid = $_REQUEST['fileid'];
$rhandle = fopen("counter.txt", "r");
$rcontent = fgets( $rhandle, filesize("counter.txt") );
$data = explode( "||", $rcontent );
$data[$fileid]+1;
$rhandle = fopen("counter.txt", "w");
$newdata = "";
for( $i = 0; $i < 3; $i++ ) {
$newdata = $data[$i].'||';
}
fwrite( $rhandle, $newdata );
fclose($rhandle);
switch($fileid) {
case 0: header( 'location: http://iwek.x10hosting.com/nightscream/graphics/free/anime1.zip' );
break;
case 1: header( 'location: http://iwek.x10hosting.com/nightscream/graphics/free/warrior1.zip' );
break;
case 2: header( 'location: http://iwek.x10hosting.com/nightscream/graphics/free/warrior2.zip' );
break;
}
?>
Last edited: