Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2006
    Posts
    89

    Sumbitting Multiple Fields/Files by email

    I have created an application, that is a training course with multiple pages. On each page, the user is given some information and asked to enter a reply by typing text into a text box which is then saved to text files in AutoPlay/Docs.

    The text boxes are therefore 'Input1', 'Input2', 'Input3', which are on Page 1, Page 2, Page 3 of the application and which save to AutoPlay/Docs/Text1.txt, AutoPlay/Docs/Text2.txt and AutoPlay/Docs/Text1.txt

    The user can come back and edit any of their pages at any time.

    When they have finished the whole course, I want them to be able to submit their answers online, so I receive them by email. But it seems a bit cumbersome to ask them to open up AutoPlay/Docs, gather and zip up all their text files and then send them in. In fact, I wouldn't get away with it professionally even if I felt comfortable with it.

    Preferably, I would like them to be able to just click a Button that I pro-configure to submit the text to an email address. So, when they click 'Submit My Course', all of the text files get gathered up and sent in.

    Can this be done?

    I would like the flexibility, in a perfect world, to move away from receiving the answers by email to having them submitted directly to a MySQl data base. Otherwise, me and my other teachers have got to open up a seperate text file for each question and read it. I would like to wait until I am a bit more experienced for that; I mention it here in case that influences the method used now. That said, if there are examples of submitting multiple text files to a data base, I would sure like to know.

    Any pointers, code snippets or links would be very much appreciated.

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    Using MySQL is a good idea for this. However, you should be familiar with SQL language (to use query and submit functions properly). To use MySQL in APMS you can use this guide.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Feb 2006
    Posts
    89

    email first, then I'll brave mysql

    OK.

    I would like to see if I can get multiple text boxes submitted by email first. Then I'll see if I can do it with mysql.

    Anyone know if it is possible. I am currently seeign if I can adapt the example here:

    http://www.indigorose.com/forums/showthread.php?t=9454

  4. #4
    Join Date
    Feb 2006
    Posts
    89

    Example seems faulty

    I am struggling because there appears ot be a problem with the example emailer.apz given to download at http://www.indigorose.com/forums/showthread.php?t=9454

    This example works, but the actual body of the email that arrives is always blank and does not cotnain the text entered by the user.

    I am not talking about any adaptation of this example, I mean the untouched pristine example as downloaded.

  5. #5
    Join Date
    Feb 2006
    Posts
    89
    Does anyone know what is going wrong here:

    Using the exampel downloaded from a thread, I have an example email/php application.

    On the web server I have a php script containing:
    ____
    <?php

    // specify recipient email address
    $to="biz@karazoo.com";

    // send our email
    mail ("$to","$subject","$body","$from");

    ?>
    ___

    On the page of the AM6 application I have three input fields as given in the example.

    On the 'Send' button on click event I have:

    ______
    -- clear error variable
    error = 0;

    -- Get values from input fields
    from = Input.GetText("Input1");
    subject = Input.GetText("Input2");
    body = Input.GetText("Input3");

    -- check for empty fields and deliver errors if needed
    if String.Length(from) < 1 then
    Dialog.Message("Error", "Please enter your email address and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(subject) < 1 then
    Dialog.Message("Error", "Please enter your email subject and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(body) < 1 then
    Dialog.Message("Error", "Please enter your email message and re-submit. Thank you.");
    error = 1;
    end

    if error~=1 then
    -- if no errors exist, send the email now and give a confirmation dialog
    HTTP.Submit("http://www.karazoo.com/mail.php", {from=from, subject=subject, body=body}, SUBMITWEB_POST, 20, 80, nil, nil);
    Dialog.Message("Success", "Success, your info has been submitted.");
    Application.Exit();
    end

    _____

    But when I submit, I reveive an email at my email address that is from 'Nobody', has no subject and an empty body.

    I have uploaded the example.
    Attached Files

  6. #6
    Join Date
    Feb 2006
    Posts
    89

    Another example

    I have found another example that may work well for me, and have attached it to this post.

    Could someone just tell me where in the AM6 code of this example do I enter the web address of the php mailer script that I have uploaded to my server accroding to the instructions at:

    http://www.indigorose.com/forums/showthread.php?p=75127

  7. #7
    Join Date
    May 2005
    Posts
    1,115
    Try this to fix your error in previous code:

    Code:
    if error~=1 then
    -- if no errors exist, send the email now and give a confirmation dialog
    HTTP.Submit("http://www.karazoo.com/mail.php", {"from="..from, "subject="..subject, "body="..body}, SUBMITWEB_POST, 20, 80, nil, nil);
    Dialog.Message("Success", "Success, your info has been submitted.");
    Application.Exit();
    end
    Last edited by bule; 02-10-2006 at 11:41 AM.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  8. #8
    Join Date
    Feb 2006
    Posts
    89

    No luck with this

    No. Unfortunately, the same thing happens.
    I get an email no problem: but No Subject, No body and it is from 'Nobody'

    Does it work for you?

  9. #9
    Join Date
    Feb 2006
    Posts
    89

    Invalid field

    Actually, when I add this code that you post, there is an error that says "Invalid field for 'next'"

Similar Threads

  1. Example: Sending Email Using a Remote PHP Web Script
    By Corey in forum AutoPlay Media Studio 5.0 Examples
    Replies: 36
    Last Post: 06-10-2007, 02:07 PM
  2. open email using multiple body lines
    By chad in forum Setup Factory 7.0
    Replies: 16
    Last Post: 01-11-2005, 08:23 AM
  3. Replies: 6
    Last Post: 12-01-2004, 12:45 PM
  4. Function: Email Any Data Through PHP
    By Brett in forum AutoPlay Media Studio 5.0 Examples
    Replies: 8
    Last Post: 10-02-2004, 08:08 PM
  5. Sending Email with Subject, Body and Attachment Filled In
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-24-2003, 01:30 PM

Posting Permissions

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