Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

404 error when submitting ASP form

Posted on 2007-10-11
11
Medium Priority
?
727 Views
Last Modified: 2008-01-09
I have the following ASP code below, which tries to call the formmail.asp script in the Bin directory. However, when I click on the submit button, I get a 404 error. I am not sure whats up with this?

            <form action="\Bin\formmail.asp" method="post">
                  <input name="_recipients" type="hidden" value="brad.britton@me.com" />
                  <input name="_requiredFields" type="hidden" value="Company, Name, Email, Phone, Information" />
                                                
                                  <table cellpadding="0" cellspacing="0" border="0" WIDTH=493 class="shane">
                  <tr>
                    <td valign="top" colspan=2><p class="shane"><strong>Notice</strong>:
                        Please fill in the relevant information and then click
                        submit. </td>
                  </tr>
                  <tr>
                    <td valign="top">Company Name:</td>
                    <td valign="top"><input type="text" name="Company" size="20" maxlength="44"></td>
                  </tr>
                  <tr>
                    <td valign="top" width=30><p class="shane">Name:</P></td>
                    <td valign="top"><input name="name" type="text" id="Name" size="20" maxlength="44"></td>
                  </tr>
                  <tr>
                    <td valign="top" width=30><p class="shane">Email:</P></td>
                    <td valign="top"><input type="text" name="Email" size="20" maxlength="44"></td>
                  </tr>
                  <tr>
                    <td valign="top">Phone:</td>
                    <td valign="top"><input name="phone" type="text" id="Phone" size="20" maxlength="44"></td>
                  </tr>
                  <tr>
                    <td valign="top" width=30><p class="shane">Information:</P></td>
                    <td valign="top"><textarea cols="24" rows="5" name="Information"></textarea></td>
                  </tr>
                  <tr>
                    <td valign="top" width=30>&nbsp;</td>
                    <td valign="top"><input type="image" name="submit" src="images/submit_request_form-button.jpg"></td>
                              
                              
                  </tr>
                </table>

</form>      

Thanks

Brad
0
Comment
Question by:bradbritton
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 37

Accepted Solution

by:
samtran0331 earned 1200 total points
ID: 20057808
what's thet relative path of this page to the bin directory?

instead of:
 <form action="\Bin\formmail.asp" method="post">

try:
 <form action="Bin/formmail.asp" method="post">

also, I"m assuming this isn't an ASP.Net application?
0
 
LVL 8

Expert Comment

by:Rog D
ID: 20057816
Remove the "/" in the beginning of the string for /bin folder.

Rog
0
 

Author Comment

by:bradbritton
ID: 20057968
now I get error 403 Forbidden....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Rog D
ID: 20058032
Looks like you don't have permission to this folder or the asp webuser does not.

Check permissions.

Rog
0
 
LVL 37

Expert Comment

by:samtran0331
ID: 20058068
That's why I asked whether this was ASP.Net or not...Web servers usually reserve the folder name "bin" or "cgi-bin" etc.  for files that are not served.
changing the permissions probably still wouldn't work...I would create a new folder for these processing pages
0
 

Author Comment

by:bradbritton
ID: 20058406
I changed the folder name to Scripts and made the changes to the website. Now I get this error.

The HTTP verb POST used to access path '/WebSite1/Scripts/formmail.asp' is not allowed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The HTTP verb POST used to access path '/WebSite1/Scripts/formmail.asp' is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[HttpException (0x80004005): The HTTP verb POST used to access path '/WebSite1/Scripts/formmail.asp' is not allowed.]
   System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +3383065
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +3335828
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161

 
HELP!!! :-)
0
 
LVL 4

Expert Comment

by:lrygiel
ID: 20059039
Check your IIS Website properties. Make sure you have execute permissions (Virtual Directory Tab) set to either "scripts only" or "Scripts and Executables". In your case I think "Scripts Only" should be sufficient.

0
 

Author Comment

by:bradbritton
ID: 20059340
I changed the settings, still get that error.I am running the site in debug mode in VS 2008, if that may also be a cause.

0
 
LVL 4

Assisted Solution

by:lrygiel
lrygiel earned 800 total points
ID: 20059535
I don't know anything about VS 2008.  IS THIS A .NET app? The question was asked twice but you didn't respond so I'm working off the assumption it IS NOT .NET, but rather classic ASP (ver 3.0).

I know you stated earlier that you moved from \bin to WebSite1/Scripts/. Get everything back in bin. The way I read this was you had the 403 access error when the script was in /bin but other errors once you moved it. The IIS setting should get rid of the 403.1 error if the scripts are in bin or cgi-bin.

I run all my served scripts from cgi-bin and as long as I had the permissions correct, I never had a problem.

0
 

Author Comment

by:bradbritton
ID: 20061505
I did this and I am still getting error 403. I am running an ASP script, but I would assume that it should still work ok. Any other ideas?
0
 
LVL 37

Expert Comment

by:samtran0331
ID: 20062274
what OS is this IIS on? Win2k3? XP?

And you're using VS2008?? The code you posted is a Classic ASP page (ends with extension *.asp) right?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question