+ Reply to Thread
Results 1 to 6 of 6

Thread: Counter won't increase problem

  1. #1
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Counter won't increase problem

    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 Code:
    <?php
        $fileid 
    $_REQUEST['fileid'];
        
        
    $rhandle fopen("counter.txt""r");
        
    $rcontent fgets$rhandlefilesize("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 
    0header'location: http://iwek.x10hosting.com/nightscream/graphics/free/anime1.zip' );
            break;
            case 
    1header'location: http://iwek.x10hosting.com/nightscream/graphics/free/warrior1.zip' );
            break;
            case 
    2header'location: http://iwek.x10hosting.com/nightscream/graphics/free/warrior2.zip' );
            break;
        }
    ?>
    Last edited by nightscream; 09-23-2006 at 05:50 PM.
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  2. #2
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: Counter won't increase problem

    i'm no expert at PHP, but why does it say
    PHP Code:
    $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
    Retired Account Manager


  3. #3
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: Counter won't increase problem

    You mean break; ?
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  4. #4
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: Counter won't increase problem

    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..
    -Chris Z
    Retired Account Manager


  5. #5
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: Counter won't increase problem

    maybe search it up, www.php.net
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  6. #6
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: Counter won't increase problem

    nvm I wrote an other one, and it works
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

+ Reply to Thread

Similar Threads

  1. CGI problem maybe?
    By boblake in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 08-24-2006, 04:15 AM
  2. Wierd problem
    By Cynical in forum Free Hosting
    Replies: 0
    Last Post: 02-09-2006, 05:58 PM
  3. Ad code problem!
    By Akkarin in forum Free Hosting
    Replies: 8
    Last Post: 08-29-2005, 10:39 AM
  4. Problem With Stats
    By Articz in forum Free Hosting
    Replies: 2
    Last Post: 04-14-2005, 04:02 PM
  5. Ftp Timeout problem
    By ironcross77 in forum Free Hosting
    Replies: 7
    Last Post: 04-12-2005, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers