Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Form to Email problem

Posted 17 Nov 2004 12:52:45
1
has voted
17 Nov 2004 12:52:45 Richard Wood posted:
On my website www.tempestdesignworks.com i have a form that is to be sent to my e-mail. It wont work! When the form is submitted it sends back an error message
"Method Not Allowed
The requested method POST is not allowed for the URL /thanks.asp"

how can i fix this?

ive inserted a copy of the source code for thanks.asp, and contact.htm

thanks for all your help

Rich

thanks.asp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>contact</title>
<style type="text/css">
<!--
@import url("tempestdesignworks.css";
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #3B391A;
}
.style1 {font-size: 12px}
a:link {
color: #993333;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
.style2 {font-size: 10px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="" {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<form name="form1" method="post" action="thanks.asp" enctype="text/plain">
<table width="100%" height="280" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" colspan="3" align="right" valign="top"><p align="justify" class="generalText">please enter your details in the form below, and i will endeavor to get back to you... </p>
<p>  </p></td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">first name</td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p>
<input name="firstname" type="text" class="generalText" id="first name" size="10">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">last name </td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="lastname" type="text" class="generalText" id="last name" size="10">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">phone number </td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="phonenumber" type="text" class="generalText" id="phone number" size="12">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top"><div align="right" class="generalText">e-mail </div></td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="email" type="text" class="generalText" id="e-mail" size="25">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="center" valign="top"><div align="right"><span class="generalText">how would you like to be contacted </span></div></td>
<td width="251" height="40" colspan="2" align="center" valign="top"><div align="left"><span class="generalText">phone
<input name="radiobutton" type="radio" value="phone" checked>
e-mail
<input name="radiobutton" type="radio" value="e-mail">
</span> </div></td>
</tr>
<tr>
<td align="center" valign="bottom"><div align="right"></div> <div align="right"></div></td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
</span></div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="right" class="generalText">message </div>
<div align="right"></div></td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
<textarea name="message" cols="26" rows="10" wrap="virtual" class="generalText" id="message">enter your message here...</textarea>
</span></div></td>
</tr>
<tr>
<td align="center" valign="bottom"> </td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
</span></div></td>
</tr>
<tr class="generalText">
<td align="center" valign="bottom"><div align="right">
<input name="Submit" type="submit" onClick="MM_validateForm('first name','','R','last name','','R','phone number','','RisNum','e-mail','','RisEmail');return document.MM_returnValue" value="submit">
</div></td>
<td align="center" valign="bottom"><div align="center"><span class="style1">
</span></div></td>
<td align="center" valign="bottom"><div align="left"><span class="style1">
<input type="reset" name="Reset" value="reset"
onClick="reload">
</span></div></td>
</tr>
</table>
</form>
</body>
</html>

contact.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>contact</title>
<style type="text/css">
<!--
@import url("tempestdesignworks.css";
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #3B391A;
}
.style1 {font-size: 12px}
a:link {
color: #993333;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
.style2 {font-size: 10px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="" {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<form name="form1" method="post" action="thanks.asp" enctype="text/plain">
<table width="100%" height="280" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" colspan="3" align="right" valign="top"><p align="justify" class="generalText">please enter your details in the form below, and i will endeavor to get back to you... </p>
<p>  </p></td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">first name</td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p>
<input name="firstname" type="text" class="generalText" id="first name" size="10">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">last name </td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="lastname" type="text" class="generalText" id="last name" size="10">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top" class="generalText">phone number </td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="phonenumber" type="text" class="generalText" id="phone number" size="12">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="right" valign="top"><div align="right" class="generalText">e-mail </div></td>
<td width="251" height="40" colspan="2" align="left" valign="middle"><p align="left">
<input name="email" type="text" class="generalText" id="e-mail" size="25">
</p>
</td>
</tr>
<tr>
<td width="99" height="40" align="center" valign="top"><div align="right"><span class="generalText">how would you like to be contacted </span></div></td>
<td width="251" height="40" colspan="2" align="center" valign="top"><div align="left"><span class="generalText">phone
<input name="radiobutton" type="radio" value="phone" checked>
e-mail
<input name="radiobutton" type="radio" value="e-mail">
</span> </div></td>
</tr>
<tr>
<td align="center" valign="bottom"><div align="right"></div> <div align="right"></div></td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
</span></div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="right" class="generalText">message </div>
<div align="right"></div></td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
<textarea name="message" cols="26" rows="10" wrap="virtual" class="generalText" id="message">enter your message here...</textarea>
</span></div></td>
</tr>
<tr>
<td align="center" valign="bottom"> </td>
<td colspan="2" align="center" valign="bottom"><div align="left"><span class="style1">
</span></div></td>
</tr>
<tr class="generalText">
<td align="center" valign="bottom"><div align="right">
<input name="Submit" type="submit" onClick="MM_validateForm('first name','','R','last name','','R','phone number','','RisNum','e-mail','','RisEmail');return document.MM_returnValue" value="submit">
</div></td>
<td align="center" valign="bottom"><div align="center"><span class="style1">
</span></div></td>
<td align="center" valign="bottom"><div align="left"><span class="style1">
<input type="reset" name="Reset" value="reset"
onClick="reload">
</span></div></td>
</tr>
</table>
</form>
</body>
</html>

Replies

Replied 17 Nov 2004 13:30:04
17 Nov 2004 13:30:04 Lee Diggins replied:
Hi Richard

From what I've read it's a web server issue and POST needs to be turned on on the web server. Call you ISP or admin.

Digga

Sharing Knowledge Saves Valuable Time!!!

Reply to this topic