No announcement yet.

Submit to web

  • Filter
  • Time
  • Show
Clear All
new posts

  • Submit to web

    I have a server side script that can accept values from a webpage form and email them to me.

    Example web form

    <form action="myscript" method="post">
    <input type="text" name="field1">
    <input type="text" name="field2">
    <input type="text" name="field3">
    <input type="submit">

    Can I submit this using AMS in a similar manner?
    I have tried storing the value of edit fields in respective variables and using the submit to web action. I entered the action value from the html form as the url as it is the url of the script, and set the submission method to post. For the parameters I used the following:

    "field1" = "%field1var%"
    "field2" = "%field2var%"
    "field3" = "%field3var%"

    %fieldXvar% being the variable containing the value of fieldX

    I used the default values for the other settings.

    This however always returns an error so I am obviously not doing it properly. Could someone tell me if it is possible to make a form in AMS that will subit it's values in a similar way to an HTML form, and if so please explain it to me. Thank you for taking the time to help.

  • #2
    Re: Submit to web

    Yes it's definitely possible and actually easy to do. I'm busy on some stuff right now but I will attempt to create a sample demo for you later using PHP and AMS. (Unless some other kind user beats me to it [img]/ubbthreads/images/icons/smile.gif[/img] )

    Corey Milner
    Creative Director, Indigo Rose Software


    • #3
      Re: Submit to web

      I tried using the script you posted in another thread:


      // set variables
      $email ="[email protected]";
      $subject ="Email from web site";
      $body ="Your email body content here.";
      $replyto ="[email protected]";

      // send email
      mail ("$email","$subject","$body","$replyto");

      // end script


      But I am still getting the folowing error:

      Could not submit to web.
      Could not parse the returned XML body/
      Address of script

      It's not the script then - so I must be submitting the information incorrectly. Any ideas?


      • #4
        Re: Submit to web


        The guys were able to help me out big time with this one.... and I have it working perfectly. Let's see if I can explain what was explained to me....

        Say for example your edit field objects are called:

        Then you have an action button or text box with the following action in the "on double click" option.

        mailto:[email protected]?Subject=Submission from your CD Rom&amp;Body=The following are details submitted by a user of the CD Rom "Test CD"%0D (This is zero D - it puts a return on the message using ASCII apparently, don't ask me! the zero A puts a line in code so it will call your variable - again don't ask me!)
        %EditName%%0D%0A%EditEmail%%0D%0A%EditAddress1%%0D %0A%EditAddress2%%0D%0A%EditComment%%0D%0DAny Other Text you may wish to include automatically on all emails sent. (You don't use the %0A when putting in normal text that you declare in the code, this deletes some of the text for some reason - guess what - don't ask me!)

        Hope this helps, play with it a bit and you will figure it out.... works on a project I'm working on at the moment!

        I do have a quick question though which is somewhat related, when using an Edit Field Object is there anyway to have the text automatically wrap to the size of the field in a bit text box for people to include comments or the like? Anytime I try to use one the text keeps going to the right and not to the next line until a return is entered..... any ideas?

        If you can read this, i have yet to write a witty and imaginative signature.... sorry...


        • #5
          Re: Submit to web

          Thanks for the reply CelticDragon, but what I am trying to do is submit the values of the fields to a server side script such as a php script. The script could then send the values via email, or process them in some other way. If I can get it to work for email, I can use it for other things as well. It also has the advantage that the user can submit the information anonymously, without revealing their email address.

          I had a look at your edit field problem but I don't know how you would do it. (I'm new to AMS, but if it can be done I'm sure someone else will be able to help.)


          • #6
            Re: Submit to web

            Two things I can recommend for trying to fix your problem since i was working my way thorugh this not too long ago.

            Most imorptantly, when you're setting the action to submit to web, make sure that the Use Variable box at the bottom right is checked. Otherwise, APM tries to use the information from your scripts rather than just submitting them. I think this is where you get the parse error from.

            Another problem I've had that you may too, is when submitting to a virtual webhost. It's not going to work, unless your host has given you either a static IP or a preview site with an IP number instead of a domain name.

            I'm not sure how clear I've been, but I'm pretty sure the Use Variable buton is your main problem. If you need anymore help getting your script right, let me know .It took me a while to figure it out, but it's easy once you understand how it works.


            • #7
              Re: Submit to web

              Ah... sorry, then I am of absolutely no use to you (as i didn't recognise a number of words you used! HaHa - not a programmer as is probably painfully obvious to the people here who know what they are doing)

              I'm sure there are others here who would be able to help you out!
              If you can read this, i have yet to write a witty and imaginative signature.... sorry...


              • #8
                Re: Submit to web

                Thanks yoni. It was the Use Variable option. It's amazing how many different scripts I tried when it was something so simple causing the problem. It works fine now. Thanks a million.


                • #9
                  Re: Submit to web

                  What goes aroudn comes around. I've gotten enough help here on the board that I'm honoured to be able to return the favour.