1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rename the written text files in numbers, eg. 1,2,3...

Discussion in 'PHP' started by ted_chou12, Dec 9, 2006.

Thread Status:
Not open for further replies.
  1. ted_chou12

    ted_chou12 New Member

    Joined:
    Nov 21, 2006
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    what i want to do is when the visitor fills out the form and press submit, i want to store the information as a text file, and call it "text1.txt", when the second visitor comes and submit another form, I want the second form to call "text2.txt", and so on.... continues to name it in accending numbers, below is my code:

    PHP:
    <?php
    $dataf 
    "1.txt";
    $file fopen("$dataf","w");
    $write fwrite($file,"not important text");
    fclose($file);
    ?>
    What code do I insert in if i want to rename the $dataf text file in numbers, eg. 1,2,3... in sequence, each time creating a new file with a interger above the last one written?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Duplicate of thread [thread=2180]rename the text files in numbers, eg. 1,2,3....[/thread] in web development forum. Thread closed.
     
Thread Status:
Not open for further replies.

Share This Page