How to download records into a text file using php?

Discussion in 'PHP' started by Notting, Nov 2, 2007.

  1. #1
    Aim:

    A php page with a button which when you click it allows you to download a text file with rows each on a new line in a text file.

    Ie:

    database:table:

    id
    name
    secondname
    email


    Then a PHP page:

    *button* click this button to download text file with emails in it

    //

    then the suer can download the text file containing the emails, each one on a new line.


    Hope someone can help me or point me in the right direction/

    Kind regards
    Notting
     
    Notting, Nov 2, 2007 IP
  2. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #2
    Read over: http://us.php.net/fwrite to find out how to write to a text file.


    Then this function found on the web will force a download of a file.
     
    exodus, Nov 2, 2007 IP