Forum Moderators: open
Apparently the use of Method "Post" in my HTML triggers the message "Method Post not allowed ..." or "I encountered an unrecoverable error..." when the 'Submit' button is clicked. Previously the form's contents were sent to a text file which was then sent to my email address. Without this ability, my small business is severely crippled. Has anyone had a similar experience? I would be willing to post my html if it would help. I hope I don't have to change web hosts but I think it has to be the new server and not my form. Any ideas or suggestions will be appreciated.
Jim
[edited by: encyclo at 1:06 am (utc) on April 22, 2006]
[edit reason] no discussion of specific hosts please, see forum charter [/edit]
If you are getting an error "Method Post not allowed", it sounds possibly like the script which is processing the form is not set as executeable. This could be either a permissions problem with the script itself or it could be that the directory does not allow executeable files.
Have you tried CHMOD 755 for the script? Which language does the script use? Perl?
Name: [name]
Company: [company]
Address: [address]
City: [city]
State: [state]
Zip: [zip]
Telephone: [voice]
etc.
etc.
<FORM Method="post" ACTION="cgi-bin/cgiemail/order_form.txt" >
Jim unless I'm missing something here, this is not possible, and this is why you are getting "post not allowed." You cannot post form data to a plain text file, it doesn't work that way. You post to an executable program, and the program performs the scripted tasks written into it - in this case store the info in the file, then email it to you.
I suggest you review your backup copies and see what changed, it should post to an executable script and the script should write to the file.
Additionally it would be helpful to know if your new server is a LINUX or MICROSOFT-based server. There **are** programs for MS-based servers that use the exact post method you have above, but the file orderform.txt is an email template, not the temp form data file, and is not even the actual path to the file - I cannot explain it better than that, but I don't think that's the problem.
Last comment - hopefully the email process of which you speak does not contain credit card data, email is not secure and this is a very dangerous method of operation.
cgiemail
I assume that this is the MIT cgiemail script available here:
[web.mit.edu...]
The syntax looks correct, the script writes to the file specified after the slash. (There is some good documentation at the above link.)
It is widely available on many hosting packages. If you see the file in your cgi-bin directory, you need to check the file permissions and set it as an executeable file. How to do that depends on your FTP program, but most have a "CHMOD" option which you can use to set the file as "r+x" or "755".
If the file is absent or if the CHMOD doesn't work, the script may need to be reinstalled by you or your hosting company.
If I use "get" vs "post" the error message goes away and the form data appears in the address bar after clicking the 'Submit' button. So, the form data is being transferred but not going where I can use it, like to my email address.
Just read your last post about a 'text' file. In an earlier post on this thread I provided an abbreviated display of the order_form.txt file I have been using for several years with my former 'cpanel' server from my web host. It is a template that pairs up the data submitted with a value (in brackets). That information was then automatically emailed to me. I am not sure what an 'executable' file for the same process would be. Could you provide an example? I am confused because of the way it worked before. The error message from 'post' has now gone away since I changed the path and entered a file permission number. The web host help said to use 754 but I used 755. A tech said 754 doesn't make any sense. I appreciate your expertise here and hope you will continue to help me resolve the issue. I am going to church now but will check back later.
[edited by: encyclo at 5:40 pm (utc) on April 23, 2006]
[edit reason] no links to personal sites please, see forum charter [/edit]
Each time I get a 500 Server error, but no more "Method post not allowed. What could be causing this? I will try a couple of the examples in the instructional site and see if they work.
It's not clear how that script gets invoked, but in looking at the servers of several sites that use cgiemail, all of them are set up just like the documentation says. I suspect that on the POST, Apache executes the first cgi file it finds in the Action path, and not necessarily the 'file' at the end of that path.
<form method ="post" Action="http://<my domain name>/cgi-bin/cgiemail/order_form.txt"
------- Executes this -------------------------------------------^
------- Uses this e-mail template -----------------------------------------^
Jim
The access log might also be useful if it contains anything really 'odd' -- Not too likely in this case.
I'd ping the host again on this one... Perhaps HTTP POSTs are not allowed to the cgi-bin directory due to an incorrect server configuration file, .htaccess, or 'control panel' setting.
You could code up a very simple 'hello world' script, and POST to that, both in cgi-bin and some other directory, just as a test (it can ignore the posted data, the point is juat to see if it executes). Simplify/reduce/divide/conquer, in other words.
Jim
Do you have command-line (SSH) access to the new server? If so you could try recompiling the script. If not, what is the new server running, and which version? There may be a pre-compiled binary available on the MIT site.