Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Convert form data to csv and send as attachment

  1. #11
    Join Date
    Feb 2007
    Posts
    82

    Default Re: Convert form data to csv and send as attachment

    I got it woohoo....thank you...it was the quotes.....I have been working on this all afternoon.......thank you thank you thank you

    and I had tried quotes, but in the html results, not the csv...

  2. #12
    Join Date
    Dec 2005
    Posts
    74

    Default Re: Convert form data to csv and send as attachment

    You're right about changing the attachment extension to csv. That will tell Excel how to import the file. The quotes will help if your imported values can have embedded spaces.

    George

  3. #13
    Join Date
    Jun 2009
    Posts
    3

    Default Re: Convert form data to csv and send as attachment

    Hello All

    Could anyone in addition to what is described below (in italic letters) on how to attach a csv file, tell me how i could name the csv file in an unique way. For example i have named my csv template file data.csv I would then like to put in a unique number infornt of the file name (ex. 32654data.csv). I have some php code on my page which generates a random number like this:

    PHP Code:
    $random_digit=rand(00000,99999); 
    I then call it in my form like this:

    HTML Code:
    <input type="hidden" name="random_digit" value="<?php echo $random_digit; ?>" />
    Is there any way that i can set this unique number in fornt of the name of the csv template file....???

    Thanks in advance...


    Apologies for misunderstanding. It's pretty straightforward. My recollection may be incomplete, but the requirements include:
    • creating a csv text file where the first line has comma-delimited field names as expected by the end users application, the second line contains comma-delimited variables from the form. For example, the first line might begin "email",... and the second line begin "$email",...
    • store this csv template file in the templates directory identified in formmail.php.
    • refer to this template file in code like this:
    HTML Code:
    HTML Code:
    <input type="hidden" name="mail_options" value="PlainTemplate={csv template file}",{other options} />
    HTML Code:
    [i][color=#ff8000]<input type="hidden" name="filter_options" value="Attach={attachment file name}" />[/color][/i]
    [i][color=#ff8000]<input type="hidden" name="filter" value="null" />[/color][/i]
    There may be some minor pieces missing, but this'll get you going. It can't be too hard - I managed to make it work!

    Good luck

    George

  4. #14
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Convert form data to csv and send as attachment

    since ur using php, just do this:

    HTML Code:
    <input type="hidden" name="mail_options" value="PlainTemplate=<?php echo rand(0,9999); ?>basefilename.htm" />

  5. #15
    Join Date
    Jun 2009
    Posts
    3

    Default Re: Convert form data to csv and send as attachment

    Thanks a lot, that did the trick...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to Parse data from one Form to another
    By CliqAdam in forum FormMail Subscription Support
    Replies: 5
    Last Post: 01-Dec-2004, 12:57 AM
  2. Adding Attachment Variables
    By Bella in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Apr-2004, 09:43 AM
  3. POST form data as well as email
    By zippy in forum FormMail Subscription Support
    Replies: 20
    Last Post: 24-Jan-2004, 04:29 PM
  4. not seeing form data
    By brownie in forum FormMail Subscription Support
    Replies: 6
    Last Post: 19-Jan-2004, 01:37 AM
  5. Help trying to set up a form to email and send info to file
    By rridsdale in forum FormMail Subscription Support
    Replies: 1
    Last Post: 14-Jan-2004, 02:38 AM

Bookmarks

Posting Permissions

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