Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150

    Submitting to PHP

    I am attempting to submit form data from AMS 6.0 to a mail.php file published on my website; that will then send an email to me containing the form data. I have attached a sample project with my notes and supporting help documentation. Any help in getting this to work would be greatly appreciated!
    Attached Files

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Can we see what your mail.php file looks like?

    Edit: Never mind... didn't see the accomanying documentation.

    Taking a look...

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Ok I made it work but I changed your project and your mail.php file.

    First, in your mail.php file you had a syntax error (missing a quote after the 'cell_phone' field) and I put all of the fields into one string called 'body'.

    First, change your mailer command in your mail.php to look like this:
    Code:
    mail ("$to","$subject","$body");
    Next, add in this line before your HTTP.Submit action in your project:
    Code:
    body = "First Name: "..first_name.."\r\nLast Name: "..last_name.."\r\nHome Phone: "..home_phone.."\r\nWork Phone: "..work_phone.."\r\nCell Phone: "..cell_phone.."\r\nProperty Address: "..property_address.."\r\nComments: "..comments
    Then change the HTTP.Submit line to look like this:
    Code:
    HTTP.Submit("http://www.realestatemediadesign.com/mail.php", {subject="Form Data Submission",body=body}, SUBMITWEB_POST, 20, 80, nil, nil);
    That should do it.

  4. #4
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150
    Thanks Tek! I'll give it a try.

  5. #5
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150
    Tek,

    I can not get it to work. I must be doing something wrong.

    You mentioned you made a change to both the project and mail.php file. What changes did you make to the project? Would you please post the project and mail.php that you made changes to? Thank you.

  6. #6
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    David,

    The changes I made to the project are in the last two pieces of code I posted. It's taken from your submit button actions.

    The changes to the mail.php file are noted in the first line.

  7. #7
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150
    Tek,

    Is this the way you have it setup?

    Code:
    <?php 
    
    // specify recipient email address 
    $to="info@realestatemediadesign.com"; 
    
    $host="relay-hosting.secureserver.net"
    
    // send our email 
    mail ("$to","$subject","$body");
    ?>
    Code:
    -- clear error variable
    error = 0;
    
    -- Get values from input fields
    first_name = Input.GetText("first_name");
    last_name = Input.GetText("last_name");
    home_phone = Input.GetText("home_phone");
    work_phone = Input.GetText("work_phone");
    cell_phone = Input.GetText("cell_phone");
    property_address = Input.GetText("property_address");
    comments = Input.GetText("comments");
    
    -- check for empty fields and deliver errors if needed
    if String.Length(first_name) < 1 then
    Dialog.Message("Error", "Please enter your first name and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(last_name) < 1 then
    Dialog.Message("Error", "Please enter your last name and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(home_phone) < 1 then
    Dialog.Message("Error", "Please enter your home phone and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(work_phone) < 1 then
    Dialog.Message("Error", "Please enter your work phone and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(cell_phone) < 1 then
    Dialog.Message("Error", "Please enter your cell phone and re-submit. Thank you.");
    error = 1;
    end
    if String.Length(property_address) < 1 then
    Dialog.Message("Error", "Please enter the property address 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
    
    body = "First Name: "..first_name.."\r\nLast Name: "..last_name.."\r\nHome Phone: "..home_phone.."\r\nWork Phone: "..work_phone.."\r\nCell Phone: "..cell_phone.."\r\nProperty Address: "..property_address.."\r\nComments: "..comments
    
    HTTP.Submit("http://www.realestatemediadesign.com/mail.php", {subject="Form Data Submission",body=body}, SUBMITWEB_POST, 20, 80, nil, nil);
    
    Dialog.Message("Success", "Success, your info has been submitted.");
    end
    These are the changes I made. Am I still doing something wrong? It's still not working.
    Last edited by David REMD; 06-09-2007 at 07:43 AM. Reason: Forgot to include information

  8. #8
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150

    Please help!

    Okay, I removed the relay-hosting.secureserver.net from the mail.php file, submitted the completed form, and received an email. However, the email "subject" and "Body" was blank...none of the form data came through. What am I doing wrong? PLease help.

  9. #9
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150

    Tek, please help!

    Tek, I can't get this to work on my end. Please post the mail.php code, and the code behind the "submit" button. I will test it on my end. If it works, then all AMS users will benefit. Thank you!

  10. #10
    Join Date
    May 2006
    Posts
    5,380
    just a tought..........

    i dont know much about php but i once had problems with a email script and it turned out to be my server had smtp disabled.....


    like i say.....just a tought
    Open your eyes to Narcissism, Don't let her destroy your life!!

  11. #11
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    David,

    The only thing I did differently was to remove the '$host' line by commenting it out and changing the '$to' string to my own email address.

    RizlaUK is right about the SMTP in PHP. It may be disabled so you might want to check it out or maybe test it again on another server.

  12. #12
    Join Date
    Apr 2007
    Location
    Elburn, IL USA
    Posts
    150

    Thank you

    Thanks to everyone that helped in supporting me! Since I could not get it to go through my godaddy.com account, I setup a designated hosting account with http://web.tera-byte.com/. I tested the form and the email came through just fine. Thanks again!

  13. #13
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Ahh good to hear.

  14. #14
    Join Date
    Jul 2007
    Posts
    1,512
    If you want to still do this i have a php scrip and amz for you to look at but
    any changers to the amz better or for worse i would ask you to resubmit to me and also would ask the same for the php script.

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. 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
  3. The dreaded Submit to web PHP issue!
    By Bruce in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 09-19-2003, 03:00 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