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:
    44
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://netfriending.co.cc
    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,375
    Likes Received:
    388
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice