20 Replies Latest reply on Jun 30, 2008 8:03 AM by CRGraphic

    formmail action & cgi scripts

    CRGraphic
      I have 2 forms I built in CS3 that have to be processed in a secure manner. I followed the advice I found online and from my webhost (network solutions) and downloaded Visual Form Mail Pro. I uploaded the cgi script files to the cgi-bin on the server and setup the permissions. When I click the submit button on the form, I get an Internal Server Error message. I think the problem is the action field on the properties panel. I cannot find anything that will tell me what the action should be. I cannot use the mailto action, the forms are for secure medical information to be forwarded to a dr's office. One other issue with how the form needs to be processed to email, is my client wants the email sent to his gmail account, how do I configure that?

      the url for the form I tried to configure is https://www.stluciegi.com/contact/patientcontact.html
        • 1. Re: formmail action & cgi scripts
          Level 7
          When I click the submit button on the
          > form, I get an Internal Server Error message. I think the problem is the
          > action
          > field on the properties panel.

          No, if you type in the script's url, it's the same 500 error message.

          The most common cause of this (if it's a Linux or Unix server) is editing
          the script and saving it with Windows type linefeeds.

          If that's the case, get a fresh copy of the script.
          go to dw preferences->Code Format->Linebreak type and change that to Unix.

          then make the configuration edits in the script.

          --
          Alan
          Adobe Community Expert, dreamweaver

          http://www.adobe.com/communities/experts/



          • 2. Re: formmail action & cgi scripts
            CRGraphic Level 1
            I did have the action incorrectly entered. I changed the Code Format in the preferences and saved all the pages and uploaded the entire site again. I have tried everything possible to correct the problem. I saved the cgi script with the same name as the form. I set the chmod permissions to 755. I uploaded the files in ascii to the ftp publisher. I still get an error message when I click the submit button. Is there a way to send a pdf file safely instead of using a form on the web page? I know my client will not pay the $300 for a digital ID for Live Cycle.
            • 3. Re: formmail action & cgi scripts
              Level 7
              there is a problem with the cgi script.

              Internal Server Error

              Either it's got windows linebreaks and is on a unix box, or it has a syntax
              error, or the "shebang" first line is pointing to the wrong location for
              where Perl is installed. Or the #shebang is not the first line. Or it's a
              windows server running Perl and as a service or doesn't have sendmail.
              Dozens of possible reasons it errors out.

              Look at the host's FAQ/support page on using Perl scripts.

              Some servers have Perl installed in odd places and off the shelf scripts
              won't work till the path is corrected.

              Google common perl script errors and go through it, or get someone to help.

              **Can you use something other than Perl, like php?
              If yes- phpformmail from here: http://developerkarma.com/projects
              is easy to set up. If you want, i can post a quick set of line by line
              instructions.

              --
              Alan
              Adobe Community Expert, dreamweaver

              http://www.adobe.com/communities/experts/



              • 4. Re: formmail action & cgi scripts
                CRGraphic Level 1
                My web hosting package is using php5 on the server. I am using a Unix web host package. I'm not really familiar with php, but I am willing to try anything at this point. I was thinking about downloading one of the dreamweaver extensions from hotdreamweaver.com, but their form to mail extension doesn't look like much more than using mailto in the action. The problem really stems from my client wanting the information in the forms to be submitted securely and then emailed to their office. Thanks for any help you can provide.
                • 5. Re: formmail action & cgi scripts
                  Level 7
                  ou can use PHP on this hosting?

                  I'd suggest using the phpformmail script.
                  here's my stock cut 'n paste on what to set to what, and why

                  1)go to http://http://developerkarma.com/projects -->phpformmail
                  download it.

                  extract the ZIP file.
                  More detailed instructions are in the docs folder. These shortcut
                  instructions are for version 1.07 of the phpformmail script.

                  2) open formmail.php in dreamweaver
                  Make the following changes (in code view, turn line numbers on)

                  2a)
                  line 4,
                  define('CHECK_REFERER', true);
                  change to:
                  define('CHECK_REFERER', false);

                  reason: too many people use a firewall or Norton security to restrict this.

                  2b)
                  Line 43
                  $referers = array('www.example.com', 'example.com');
                  change to the domain name of your web site.

                  reason: this probably isn't needed since we just turned the referrer
                  checking off. but change it anyway.

                  2c)  *this is to hard-code the recipient address into the php
                  file, where it is totally invisible *
                  Line 46
                  $recipient_array = array();
                  change to:
                  $recipient_array = array('me' => 'youremailaddr...@example.com');

                  **of course, replace youremailaddress@example.com  with the email address
                  you want to receive the form data. Also note the single quote marks.
                  reason: this sets the email address the form results will be sent to.
                  You can also make a list of possible recipient alias values- see the readme
                  in the docs folder.

                  2d) give the script a default "From" address to use.
                  Go to line 41
                  Change:
                  define('FROM', null);
                  to:
                  define('FROM', 'Example Name <myaddress@example.com>');
                  substituting your name and email address.

                  3) now do a File-->Save As and save this file to within this Local Site
                  folder. save it as anythingyouwant.php

                  4) in dw's File Panel, find anythingyouwant.php and upload it to the remote
                  site.

                  5) Now open your form html file in dreamweaver,

                  5a)click the mouse into the form area, and select the <form> tag on the
                  lower left margin of the design window.
                  In the Property Inspector, it should now show the properties of the <form>
                  tag. In the Property Inspector, to the right of the ACTION line, click the
                  folder icon and browse to and select the anythingyouwant.php file
                  you've saved to within this site.

                  5b) now click within the form area and go to dw menu-->Insert-->Form
                  Objects-->Hidden Field
                  This inserts a hidden form field.
                  In the property inspector, change the NAME/ID of this field to: recipient
                  And the VALUE of this field to: me
                  the code should look like:
                  <input name="recipient" type="hidden" id="recipient" value="me">
                  This tells the script to use the "me" recipient_alias value as the email
                  address to send the form to.

                  5c: Do you have a form field to collect the user's email address?
                  If yes, if this field is named exactly "email" then the script will use the
                  user's email as the reply to in the outgoing email

                  6) Save and upload the form page.

                  Try the form from the website.

                  Optional:
                  1-make a new page for a thank you for submitting message.
                  In the form, insert another hidden field.
                  Name: redirect
                  Value:  the full absolute http:// address to the new thank you page.
                  If you don't set a redirect value- the form script will build a "thank you,
                  here is what you submitted" page. If you want to use that dynamic page-
                  upload the .css file that it uses.

                  2- If you have a field in the form to collect the visitor's email address,
                  IF you name this field  in the form exactly    email   then the visitor's
                  email address will be the Reply To address in the outgoing email.

                  There are 30 or so other optional form fields to control the form- see the
                  readme in the docs folder. One of those optional control fields is
                  verification.



                  --
                  Alan
                  Adobe Community Expert, dreamweaver

                  http://www.adobe.com/communities/experts/



                  • 6. Re: formmail action &amp; cgi scripts
                    CRGraphic Level 1
                    I think I am on the right path with your instructions. However, I am getting the following message when I click submit:

                    The following errors were found:

                    * Nothing was sent by a form. (No data was sent by POST or GET method.) There is nothing to process here.

                    Please use the back button to correct these errors.
                    • 7. Re: formmail action &amp; cgi scripts
                      CRGraphic Level 1
                      I forgot to include the url for both pages:

                      https://www.stluciegi.com/contact/physicianreferral.html
                      https://www.stluciegi.com/contact/physicianreferral.php
                      • 8. Re: formmail action &amp; cgi scripts
                        Level 7
                        I'm guessing you caught the error?

                        The following information has been submitted:
                        Physician: s
                        dayphone: s
                        email: s
                        reason: s
                        patient: s
                        patientaddress: s
                        city: s
                        homeph: s
                        workph: s
                        insurer: s
                        primaryinsnumber: s
                        secinsurer: s
                        secinsnumber: s
                        additional: w
                        submit: Submit

                        --
                        Alan
                        Adobe Community Expert, dreamweaver

                        http://www.adobe.com/communities/experts/



                        • 9. Re: formmail action &amp; cgi scripts
                          CRGraphic Level 1
                          I'm not sure how it worked for you. But I am still getting the same message about nothing to send. I am going to try a different computer.
                          • 10. Re: formmail action &amp; cgi scripts
                            CRGraphic Level 1
                            I'm not sure how it was working so briefly for you last night. But I cannot get it to work for me in IE or Firefox on either of my computers. I have checked all of the lines you told me to enter in the php and the html form. I have tried the referrer as true & false. I set the hidden field in the form to the email address like the example on in the doc. Any other suggestions?
                            • 11. Re: formmail action &amp; cgi scripts
                              Level 7
                              The following errors were found:

                              * You are trying to send mail to an address that is not listed in the
                              recipient array.
                              * There is no recipient to send this mail to. Please read the manual
                              section titled "Form Configuration - Recipient".



                              you've broken it in some change you made.

                              suggest you use the recipient_alias method i explained.

                              --
                              Alan
                              Adobe Community Expert, dreamweaver

                              http://www.adobe.com/communities/experts/



                              • 12. Re: formmail action &amp; cgi scripts
                                CRGraphic Level 1
                                I have changed the value of the hidden field in the html file to stluciegi like i set the name for in the recipient array in the php. The check referrer is false. The form name is the same as the php. Still getting the same error of nothing sent by form.
                                • 13. Re: formmail action &amp; cgi scripts
                                  Level 7
                                  The following information has been submitted:
                                  Physician: aaa
                                  email: aaa
                                  patientaddress: aaa
                                  submit: Submit

                                  it works for me because i have javascript disabled.

                                  suggestion-
                                  remove the javascript validation.

                                  it will then work for you.

                                  then either use the validation built into the formmail script [read the
                                  readme docs], or properly apply the js validation to the SUBMIT button,
                                  instead of to an input field.

                                  <input name="Physician" type="text" id="Physician"
                                  onblur="MM_validateForm('Physician','','R');return document.MM_returnValue"
                                  size="60" maxlength="80" />
                                  </label>

                                  --
                                  Alan
                                  Adobe Community Expert, dreamweaver

                                  http://www.adobe.com/communities/experts/



                                  • 14. Re: formmail action &amp; cgi scripts
                                    CRGraphic Level 1
                                    Thanks, i will give that a try.
                                    • 15. Re: formmail action &amp; cgi scripts
                                      CRGraphic Level 1
                                      I removed the validations from the form fields. Still not working on either of my pc's
                                      • 16. Re: formmail action &amp; cgi scripts
                                        Level 7

                                        > I removed the validations from the form fields. Still not working on either of
                                        > my pc's

                                        a guess- but the <label> tags are used in an odd way- they aren't adding
                                        anything, and in places enclose more than one form element.

                                        make a backup copy of the page, then use find and replace-->specific
                                        tag->label to strip them out and try it again.

                                        --
                                        Alan
                                        Adobe Community Expert, dreamweaver

                                        http://www.adobe.com/communities/experts/



                                        • 17. Re: formmail action &amp; cgi scripts
                                          CRGraphic Level 1
                                          I saved the file as a copy, deleted all of the form fields, added all new form fields w/ new labels. Disabled javascript in IE, if I disable java in Firefox, my dropdown menus do not work. But I am still not getting a completed form. The properties for the form are name:physicianreferral, action: points to physicianreferral.php, method: post, enctype : text/plain. Hidden field: recipient, stluciegi.
                                          • 18. Re: formmail action &amp; cgi scripts
                                            CRGraphic Level 1
                                            I couldn't let this go on longer than today. I went to Barnes and Noble and read the form section of all the PHP books, no help there. I went ahead and downloaded the extension from hotdreamweaver.com and it is working for me. Thanks again for all of the help.
                                            • 19. Re: formmail action &amp; cgi scripts
                                              The most common cause of this (if it's a Linux or Unix server) is editingthe script and saving it with Windows type linefeeds. this is not the situation will you please give another option
                                              • 20. Re: formmail action &amp; cgi scripts
                                                CRGraphic Level 1
                                                I did have to change the linefeed from windows type, but it did not help. The extension from hotdreamweaver works fine. I have even added a line for a copy of the form to be sent to the person filling out the form, no problems at all. It is definitely worth the $29 they charge, it saves so much time.