Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP contact form -> comma separated text file

    Is it posssible to have a php create a text file and output the values from a contact form to it? If so, how simply

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's possible and not quite hard. You need to get the data sent through the contact form, validate it, and upon successful validation you store them in the text file.

    Have a look at form processing ($_POST, $_GET) and file writing, especially

    fopen() - http://www.php.net/manual/en/function.fopen.php
    fwrite() - http://www.php.net/manual/en/function.fwrite.php
    fclose() - http://www.php.net/manual/en/function.fclose.php

    There is lots of sample code in the maunal, particularly in the user notes to each function involved.
    De gustibus non est disputandum.


  •  

    Posting Permissions

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