Counter won't increase problem

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 ||

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:

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
i'm no expert at PHP, but why does it say
PHP:
$newdata = "";
shouldn't there be something between the two quotations? whoops lol just released it said...ya nvm lmao umm, is there supposed to be some thing at the end saying like kill file or something, i'm not sure but ya that could be the case :dunno:
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
umm..no, i don't think so, darn i wish i could remember, like when you do a picture for a php file, and you have to say like kill PNG or something like that..
 
Top