Web Analytics Made Easy -
StatCounter Wanted: form processing CGI script - CodingForum

Announcement

Collapse
No announcement yet.

Wanted: form processing CGI script

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

  • Wanted: form processing CGI script

    Hello all. I hope my request is simple enough. I am after a script that processes a form found on a web page and returns the contents of the form to an email address specified in the script. The script I am using at the moment does not seem to work. When I click the submit button on my web page, I get a message asking me do I want to open the script. The script needs to be easily modifiable.

    I am unable to upload the script for checking due to a copyright message on the script not allowing the emailing of the script in whatever form. I was using a script obtained from www.form2email.net.

    I have enclosed a copy of the web page I created, if it is of any help!

    Any help appreciated!

    -----------------------------------------------------------------------------

    UPDATE: I downloaded a script from the site mentioned by KevinADC - thank you! - modified it, and tested it. I am still getting the same problem - when I click the Submit button on the web page that contains the form, I get a message asking me if I want to save the script (FormMail.pl). I feel that, maybe, the script is not the issue. I have enclosed the webpage I use. If you are good at debugging web pages, please let me know if there is an error on the page!

    Again, thanks!

    Onesimus
    Attached Files
    Last edited by Onesimus; Apr 9, 2009, 05:55 PM.

  • #2
    Well, the one that mostly gets recommend these days is NMS formmail:

    You can find it on this page:

    http://nms-cgi.sourceforge.net/scripts.shtml

    Not real easy to setup so take your time reading all the instructions and expect to put some time into getting in running.

    Comment


    • #3
      Originally posted by Onesimus View Post
      I downloaded a script from the site mentioned by KevinADC - thank you! - modified it, and tested it. I am still getting the same problem .......
      If you are getting the same error, it would suggest to me that something in your scripts hasn't been changed and so, your form submission, possibly, goes to the same (old) formmail script. check the form action in your web form just to be sure it is posting to the nms_formMail script

      hth

      bazz
      "The day you stop learning is the day you become obsolete"! - my late Dad.

      Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
      Useful MySQL resource
      Useful MySQL link

      Comment


      • #4
        When I click the submit button on my web page, I get a message asking me do I want to open the script.
        That generally means the script is not in a folder that is designated to run scripts and the file extension is unknown to the browser so it prompts you to download or open it with another application. Usually there is a cgi-bin folder where CGI scripts go. Your hosting service should have some basic instructions about where scripts should go, the path to perl, etc.

        Comment


        • #5
          Thanks again KevinADC. Sorry to say, but I do have a cgi-bin folder where I have been storing my scripts and on the web page itself the following is included:

          <form method="post" action="http://www...../cgi-bin/FormMail.pl">

          This is getting to be a tough one!

          Onesimus

          Comment


          • #6
            Well it sounds like the cgi-bin folder is not setup properly. Can you run any cgi script? Try this simple test:

            Code:
            #!/usr/bin/perl
            print "Content-type: text/html\n\n";
            print "<h1>If you see this it works</h1>";

            Comment


            • #7
              Hello KevinADC

              Tried your script. Still getting the same message "You are trying to open FormMail.pl ......". So, if you suspect, the cgi-bin folder has not been set up correctly, how do you go about doing it? Given the fact that it is asking me to open the script, the webpage knows where to find the script!

              Again, thanks!

              Onesimus

              Comment


              • #8
                Did you use Kevin's script in a file of its own?

                Did you make a perl file called test.pl and, in it, place the code posted by Kevin? if so, you can call it with http://www.yourdomain.com/cgi-bin/test.pl

                There is no way that it could give you that error in relation to formmail.

                make sure, though, you set the permissions for the file to be 755.

                hth

                bazz
                "The day you stop learning is the day you become obsolete"! - my late Dad.

                Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
                Useful MySQL resource
                Useful MySQL link

                Comment


                • #9
                  Thanks bazz

                  Tried exactly what you said. Still the same error msg!

                  However, I followed up your suggestion in checking permissions - am using Fetch on a Mac. Permission had been set to 644. When I set permission to 755, Fetch immediately came up with this error msg: "Fetch could not set permissions for test.pl as the server sent an unexpected response. Server responded: command not implemented" Viewing the Fetch transcript revealed the following:

                  257 "/cgi-bin" is current directory
                  SITE CHMOD 755 test.pl
                  502 Command not implemented
                  ftp_cmd/ftp_user: 2,-30000 (state == SETTING_PERMS)

                  I tried playing around setting permissions on test.pl from 000 to 777 - server rejected them all. It seems the only valid permission is 644! Simply, the server is not executing scripts.....It seems there is nothing wrong with the scripts after all! Testing a few webpages that are part of the site I am coordinating shows that they all have permissions set to 644. It seems I have to get in contact with the IT Dept and find out why 755 is not permitted!

                  Thanks KevinADC and bazz from the Land DownUnder

                  Onesimus

                  Comment


                  • #10
                    Originally posted by Onesimus View Post
                    However, I followed up your suggestion in checking permissions - am using Fetch on a Mac. Permission had been set to 644. When I set permission to 755, Fetch immediately came up with this error msg: "Fetch could not set permissions for test.pl as the server sent an unexpected response. Server responded: command not implemented" Viewing the Fetch transcript revealed the following:

                    257 "/cgi-bin" is current directory
                    SITE CHMOD 755 test.pl
                    502 Command not implemented
                    ftp_cmd/ftp_user: 2,-30000 (state == SETTING_PERMS)

                    I tried playing around setting permissions on test.pl from 000 to 777 - server rejected them all. It seems the only valid permission is 644! Simply, the server is not executing scripts.....It seems there is nothing wrong with the scripts after all! Testing a few webpages that are part of the site I am coordinating shows that they all have permissions set to 644. It seems I have to get in contact with the IT Dept and find out why 755 is not permitted!
                    you are not allowed to change permission from your ftp client. You can do one of this:
                    - change permision of the file before upload, I guess your ftp client will preserve it.
                    - change it from cpanel filemanager( if you use cpanel or whatever you use)
                    - ask server administrator to change permision for that file
                    - use ssh

                    best regards

                    Comment

                    Working...
                    X