Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2005, 08:29 PM
Authorized User
 
Join Date: May 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Asp & Forms error

Method Not Allowed
The requested method POST is not allowed for the URL /news/myxml.asp.
Hi k here is the asp file:

<%@ Language=VBScript %>
<%
Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fsoObject, fileName, filTextStream, strName, strEmail, strMessage, strDate, strData, strOldData, x, filepath
Dim process
'Get Path of Current ASP file
filepath = Server.MapPath("myxml.asp")
'Use The Path
filepath = left(filepath, len(filepath) - 9)

Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")
Set fileName = fsoObject.GetFile(filepath & "myxml.xml")
Set filTextStream = fileName.OpenAsTextStream(ForReading, TristateFalse)

strOldData = filTextStream.ReadAll
x = len(strOldData) - 13

strData = Mid(strOldData, 1, x)
'Response.Write strData
filTextStream.close
Set filTextStream = fileName.OpenAsTextStream(ForWriting, TristateFalse)
strDate = Date
strName = Request.Form("strName")
strEmail = Request.Form("strEmail")
strMessage = Request.Form("strMessage")

'strData = Mid(strData, 32)
strData = strData & vbcrlf & "<entry>" & vbcrlf
strData = strData & "<date>" & strDate & "</date>" & vbcrlf
strData = strData & "<name>" & strName & "</name>" & vbcrlf
strData = strData & "<email>" & strEmail & "</email>" & vbcrlf
strData = strData & "<message>" & strMessage & "</message>" & vbcrlf
strData = strData & "</entry>" & vbcrlf
strData = strData & "</sqltable>"


filTextStream.Write strData
filTextStream.close

Set fsoObject = nothing
set fileName = nothing
set filTextStream = nothing
process = true
Response.Expires = 0

If process = true then
    Response.Redirect "index.html"
End If


%>

 
Old June 3rd, 2005, 03:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

sounds like a config problem, nothing to do with your code.

open up the IIS MMC, check the properties of your 'news' virtual dir. You need to look at the verbs on the Mappings tab, which you can get to by clicking the Configuration button. Check that the verb POST is allowed against asp files, if not then add it.

hth
Phil
 
Old June 3rd, 2005, 04:03 AM
Authorized User
 
Join Date: May 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well im not the host so it looks like i might have to figure out how to do the same thing in php. I got this from support when i asked to enable form post.

Hello,

Unfortunately, we do not support ASP on our servers. You can use the following server-side scripting languages with our services:
PHP
Perl
Python
Ruby

Best Regards,
Support



 
Old June 3rd, 2005, 04:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

well that explains it. If your host doesn't support asp then there is no POST verb configured for asp files, hence the error.

looks like you need to either use another language or change hosts.
rgds
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
Save & Delete Forms Garner VB How-To 13 March 27th, 2008 09:14 PM
User Forms & Checking Input JezLisle Excel VBA 0 February 6th, 2008 08:34 AM
Compilation Error with ASP.Net 2.0 & IIS 5.1 gmitchell7 ASP.NET 2.0 Basics 0 April 17th, 2006 04:52 PM
Authenticating using forms & user impersonation axelgunn General .NET 0 January 26th, 2005 05:53 PM
Crystal reports & ASP - Runtime Error - Pls Help Prasad_Tina Classic ASP Basics 0 January 21st, 2005 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.