Announcement

Collapse
No announcement yet.

PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP

    I would like to send information gleaned from an AMS CD to a PHP server that would in turn send me an e-mail with that information.
    Someone was shown how to setup this up here on the forum but I can’t find it any more.

  • #2
    Re: PHP

    Here is one that Corey the PHP advocate responded to.

    http://www.indigorose.com/ubbthreads...amp;PHPSESSID=
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment


    • #3
      Re: PHP

      Should my .PHP be in the root i.e www.mysite.com/process.php or www.mysite.com/docs/process.php ???

      Comment


      • #4
        Re: PHP

        Depends where you're pointed too, either will work fine...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          Re: PHP

          Ok this is what I have in my AMS:
          <IR_ACTIONS_LIST>
          <Action name="Read">
          <Type>31</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <Variable>%cdname%</Variable>
          <FileName>%SrcDir%\Data\CD Name.txt</FileName>
          </Action>
          <Action name="Set Text">
          <Type>75</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <ObjectName>Text1</ObjectName>
          <Text>%cdname%</Text>
          </Action>
          <Action name="Submit to Web">
          <Type>144</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <URL>http://www.diginetx.com/process.php</URL>
          <Timeout>10</Timeout>
          <Port>80</Port>
          <SubmissionType>0</SubmissionType>
          <Parameters>CD Name;;%cdname%</Parameters>
          <UseHTTPAuthentication>0</UseHTTPAuthentication>
          <HTTPUserName/>
          <HTTPPassword/>
          <ProxyAddress>%UserProxyAddress%</ProxyAddress>
          <ProxyPort>%UserProxyPort%</ProxyPort>
          <ProxyUserName>%UserProxyUserName%</ProxyUserName>
          <ProxyPassword>%UserProxyPassword%</ProxyPassword>
          <UseVariable>0</UseVariable>
          <Variable/>
          </Action>
          </IR_ACTIONS_LIST>

          This is the error code I get:
          "Could not submit to web. Error code returned by server."

          On the server's Log I get this:
          [14/Jul/2003:09:09:37 -0700] "HEAD /process.php HTTP/1.0" 200 0

          Any ideas?

          Thx!

          Comment


          • #6
            Re: PHP

            Ok the server side I have:

            <?php

            // set variables
            $email ="[email protected]":
            $subject ="CD Name":
            $body ="%cdname%.":
            $replyto ="[email protected]":

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

            // end script
            exit;

            ?>

            Should the body look like this?
            <font color=red>$body ="%cdname%.":</font color=red>

            Or should I not have the variable name in it?

            HELP!

            Comment


            • #7
              Re: PHP

              Ok...
              found one problem:

              <?php

              // set variables
              $email ="[email protected]"<font color=red>;</font color=red>
              $subject ="CD Name""<font color=red>;</font color=red>
              $body ="%cdname%.""<font color=red>;</font color=red>
              $replyto ="[email protected]""<font color=red>;</font color=red>

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

              // end script
              exit;

              ?>

              I am still gettin the error tho! Any PHP due masters out there? H e l l u.....

              Comment


              • #8
                Re: PHP

                You have a bunch of double quotes there, where there should only be one.

                $subject ="CD Name<font color=red>""</font color=red>;
                $body ="%cdname%.<font color=red>""</font color=red>;
                $replyto ="[email protected]<font color=red>""</font color=red>;
                --[[ Indigo Rose Software Developer ]]

                Comment


                • #9
                  Re: PHP

                  Other then that, does everything else look right?

                  Comment


                  • #10
                    Re: PHP

                    This is what I changed it to:

                    <?php

                    // set variables
                    $email ="[email protected]";
                    $subject ="CD Name";
                    $body ="";


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

                    // end script
                    exit;

                    ?>

                    Notice the "body" of the message... What do I place there?

                    In my Submit to Web Parameters I have "CD Name"="%cdname%". The Variable %cdname% has been read from a text file with a TextFile-Read Action. I want this variable information to be placed into the body of the email that the .PHP sends to me. Is this right?

                    I get the email but no body.

                    Comment


                    • #11
                      Re: PHP

                      I even tryed this thread:
                      http://www.indigorose.com/ubbthreads...amp;PHPSESSID=

                      I can't get it to fly! HELP!

                      Comment


                      • #12
                        Re: PHP

                        Bruce, sorry I deserted you today, I was tied up doing some PHP coincidentally. [img]/ubbthreads/images/icons/smile.gif[/img] Did you get this working yet? If not, let me know and I'll get it going for you...

                        Corey Milner
                        Creative Director, Indigo Rose Software

                        Comment


                        • #13
                          Re: PHP

                          Nope! I would have posted it along with how much hair I pulled out! LOL

                          THANKS!

                          Comment


                          • #14
                            Re: PHP

                            OK, first the PHP portion:


                            <?php

                            // set variables
                            $email ="[email protected]";
                            $subject ="CD Name";


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

                            // end script
                            exit;

                            ?>

                            leave the $body="" out, just use what I have above. Save it as "process.php" somwhere on your server, i.e. http://www.groovybanana.com/process.php. You will set the body variable from AMS...

                            Now in AMS use an INTERNET > SUBMIT TO WEB action to send the email. Set the URL to your script, i.e. http://www.groovybanana.com/process.php and leave everything else at the default settings. Add the body variable to the "parameters" area by pressing the little page icon under the "parameters" area. You will get a little pop-up window with a NAME area and a VALUE area, in the name area type body and in the value area add whatever variabe you want to pass as the body of your email, i.e. %yourMessageBody%.

                            That's it, if it doesn't work re-read this post and try again, I guarantee this will work...

                            Corey Milner
                            Creative Director, Indigo Rose Software

                            Comment


                            • #15
                              Re: PHP

                              Thanks Corey, but it's not working!
                              Here's the full 4.00KB Zip:

                              http://www.diginetx.com/downloads/PHP.zip

                              Comment

                              Working...
                              X