Results 1 to 2 of 2

Thread: php 5.2.5

  1. #1

    php 5.2.5

    this php script (wich reads flash) works fine on php_v4_2_3 but i upgraded on version 5.2.5 and it doesnot works can anyone helps me?


    <?
    /***************************************
    my real counter v.1

    by sephiroth
    Alesandro Crugnola
    alessandro@sephiroth.it

    ***************************************/

    /*************************************
    ASSICURARSI DI AVERE I PERMESSI IN SCRITTURA NELLA DIRECTORY DOVE
    INSERIRETE IL FILE "coun.txt" E UPLOADARE IL FILE
    CON I PERMESSI IN LETTURA E SCRITTURA PER TUTTI
    *************************************/

    //leggo dal file di testo
    $file_name = "count.txt";
    // se il file non esiste lo creo
    if(!is_file($file_name)){
    $fp1 = fopen($file_name,"w");
    $newvar = "numero=0";
    fwrite($fp1,$newvar,1024);
    fclose($fp1);
    setcookie ("counter","sephiroth counter",0,""); // Aggiungo il cookie (di sessione)
    } else {
    // estraggo i dati del file
    $fcontents = file ('count.txt');
    while (list ($line_num, $line) = each ($fcontents)) {
    $nome = explode("=",$line);
    }

    // se il cookie esiste giа
    if(isset($_COOKIE['counter'])){
    $newvar = "$nome[0]=$nome[1]";
    } else {
    // se il cookie non esiste
    $nome[1]++;
    $newvar = "$nome[0]=$nome[1]";
    $fp = fopen($file_name,"w"); // apro il file in scrittura
    fwrite($fp,$newvar); // scrivo sul file di testo
    fclose($fp); // chiudo il file
    setcookie ("counter","sephiroth counter",0,""); // Aggiungo il cookie (di sessione)
    }
    }
    ?>
    <?=$newvar?>

  2. #2
    How exactly does it "not work"? Are you getting any error messages? Did you check if php.ini allows for short tags?
    Wait, what?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012