javant4u
03-20-2008, 02:55 PM
:confused:
Anyone who is willing to help it would be appreciated
Please understand I do not understand programming except how to program the remote ...
I need help and when I asked I guess because I am stupid and did not know how to ask it properly I got no where
so I did some google searching to at least help me to understand the terms I should use to ask for help
I have a website with Microsoft Hosting and ASP
it is required to use Go Daddy ASP form mail ? Code ? to use their form mail
so here is my problem
I am getting spammed even with a validator they are spamming without filling all the required boxes ? Illiterate remember ... :confused:
If someone can help I would like to have the code fixed or the contact form so that I can have something that gets ISP or IP when the contact form is filled in so I can see who is doing this
A capcha item so I can know if it is a real person or not
then maybe something to try blocking the ISP or IP after I find out who it is
HERE IS THE FORM OR CODE ?
<%
Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("\ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
Function FormatVariableLine(byval var_name, byVal var_value)
Dim tmpStr
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
tmpStr = tmpStr & var_value & vbCRLF
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
FormatVariableLine = tmpStr
end function
Sub OutputLine(byVal line)
outfile.WriteLine(line)
end sub
if err.number = 0 then
Set outfile = fso.CreateTextFile(filename, true, false)
if err.number <> 0 then
bErr = true
errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
else
if(req_method = "GET") then
for each Item in request.QueryString
if item <> "" then
bEmpty = false
key = item
value = Request.QueryString(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
elseif (req_method = "POST") then
for each Item in request.form
if item <> "" then
bEmpty = false
key = item
value = Request.form(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
end if
outfile.close
end if
if(bEmpty = true) AND errStr = "" then
bErr = true
errStr = errStr & "<br>No variables sent to form! Unable to process request."
end if
if(bErr = false) then
if (landing_page <> "") then
response.Redirect "http://" & host_url & "/" & landing_page
else
response.Redirect "http://" & host_url
end if
else
Response.Write errStr
end if
set fso = nothing
else
Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>
and here is my contact form with my validator
short and simple
<script type="text/javascript" src="scripts/vldtr.js">
var reqArr = new Array();
function validate(frm) {
var errs = '';
for (var i=0; i < reqArr.length; i++) {
var isError = false;
var els = document.getElementsByName(reqArr[i]);
if (els.length == 1) {
isError = (els[0].value == '');
}
else {
var chk = false;
for (var j=0; j < els.length; j++) {
if (els[j].checked) { chk = true; break; }
}
isError = !chk;
}
if (isError) { errs = errs + reqArr[i].substring(5) + '\n'; }
}
if (errs != '') {
alert('Please complete the following:\n\n' + errs);
return false;
}
var frmEls = frm.elements;
for (var i=0; i < frmEls.length; i++) {
if (frmEls[i].type.toLowerCase() == "submit") {
frmEls[i].disabled = true;
frmEls[i].value = 'Please Wait...';
break;
}
}
return true;
}
</script>
<div style="border: 10px groove rgb(255, 204, 51); width: 468px; margin-bottom: 5px;">
<form method="POST" onsubmit="return validate(this)" action="gdform.asp" name="formmail"><input type="hidden" name="subject" value="Form Submission">
<input type="hidden" name="subject" value="INFO"><input type="hidden" name="recipient" value="OWNER"><input type="hidden" name="redirect" value="/thanks.shtml"><br>
<p align="center"><FONT SIZE="+1"><B>CONTACT FORM</B></FONT></p>
<hr width="65%" noshade color="#ECA43E" align="center"><br>All Items must be filled
<table class="contact">
<tr>
<td background="images/©sandybgrd.gif" ><font color="#993300" size="3">*NAME:</font></td>
<td valign="middle" align="left"><input id="01 - NAME:" name="01 - NAME:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "01 - NAME:"</script></td>
</tr>
<tr>
<td background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*EMAIL:</font></td>
<td valign="middle" align="left"><br><input id="02 - EMAIL:" name="02 - EMAIL:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "02 - EMAIL:"</script></td>
</tr>
<tr>
<td background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*CONFIRM<br>EMAIL:</font></td>
<td valign="middle" align="left"><br><input id="03 - CONFIRM EMAIL:" name="03 - CONFIRM EMAIL:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "03 - CONFIRM EMAIL:"</script></td>
</tr>
<tr>
<td valign="top" background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*YOUR<br>QUERY:</font></td>
<td valign="middle" align="left"><br><textarea id="04 - YOUR QUERY:" name="04 - YOUR QUERY:" rows="5" cols="37"></textarea><script type="text/javascript">reqArr[reqArr.length] = "04 - YOUR QUERY:"</script>
<br>
<div align="center>
<p align="left"><input onclick="if (!validate(form)) return; form.submit();" value="CLICK TO SUBMIT " name="05 - CLICK TO SUBMIT " type="button">
<input value="RESET" name="reset" type="reset" type="button"> </p></div></td>
</tr>
</table>
</form>
Anyone who is willing to help it would be appreciated
Please understand I do not understand programming except how to program the remote ...
I need help and when I asked I guess because I am stupid and did not know how to ask it properly I got no where
so I did some google searching to at least help me to understand the terms I should use to ask for help
I have a website with Microsoft Hosting and ASP
it is required to use Go Daddy ASP form mail ? Code ? to use their form mail
so here is my problem
I am getting spammed even with a validator they are spamming without filling all the required boxes ? Illiterate remember ... :confused:
If someone can help I would like to have the code fixed or the contact form so that I can have something that gets ISP or IP when the contact form is filled in so I can see who is doing this
A capcha item so I can know if it is a real person or not
then maybe something to try blocking the ISP or IP after I find out who it is
HERE IS THE FORM OR CODE ?
<%
Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("\ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
Function FormatVariableLine(byval var_name, byVal var_value)
Dim tmpStr
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
tmpStr = tmpStr & var_value & vbCRLF
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
FormatVariableLine = tmpStr
end function
Sub OutputLine(byVal line)
outfile.WriteLine(line)
end sub
if err.number = 0 then
Set outfile = fso.CreateTextFile(filename, true, false)
if err.number <> 0 then
bErr = true
errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
else
if(req_method = "GET") then
for each Item in request.QueryString
if item <> "" then
bEmpty = false
key = item
value = Request.QueryString(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
elseif (req_method = "POST") then
for each Item in request.form
if item <> "" then
bEmpty = false
key = item
value = Request.form(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
end if
outfile.close
end if
if(bEmpty = true) AND errStr = "" then
bErr = true
errStr = errStr & "<br>No variables sent to form! Unable to process request."
end if
if(bErr = false) then
if (landing_page <> "") then
response.Redirect "http://" & host_url & "/" & landing_page
else
response.Redirect "http://" & host_url
end if
else
Response.Write errStr
end if
set fso = nothing
else
Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>
and here is my contact form with my validator
short and simple
<script type="text/javascript" src="scripts/vldtr.js">
var reqArr = new Array();
function validate(frm) {
var errs = '';
for (var i=0; i < reqArr.length; i++) {
var isError = false;
var els = document.getElementsByName(reqArr[i]);
if (els.length == 1) {
isError = (els[0].value == '');
}
else {
var chk = false;
for (var j=0; j < els.length; j++) {
if (els[j].checked) { chk = true; break; }
}
isError = !chk;
}
if (isError) { errs = errs + reqArr[i].substring(5) + '\n'; }
}
if (errs != '') {
alert('Please complete the following:\n\n' + errs);
return false;
}
var frmEls = frm.elements;
for (var i=0; i < frmEls.length; i++) {
if (frmEls[i].type.toLowerCase() == "submit") {
frmEls[i].disabled = true;
frmEls[i].value = 'Please Wait...';
break;
}
}
return true;
}
</script>
<div style="border: 10px groove rgb(255, 204, 51); width: 468px; margin-bottom: 5px;">
<form method="POST" onsubmit="return validate(this)" action="gdform.asp" name="formmail"><input type="hidden" name="subject" value="Form Submission">
<input type="hidden" name="subject" value="INFO"><input type="hidden" name="recipient" value="OWNER"><input type="hidden" name="redirect" value="/thanks.shtml"><br>
<p align="center"><FONT SIZE="+1"><B>CONTACT FORM</B></FONT></p>
<hr width="65%" noshade color="#ECA43E" align="center"><br>All Items must be filled
<table class="contact">
<tr>
<td background="images/©sandybgrd.gif" ><font color="#993300" size="3">*NAME:</font></td>
<td valign="middle" align="left"><input id="01 - NAME:" name="01 - NAME:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "01 - NAME:"</script></td>
</tr>
<tr>
<td background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*EMAIL:</font></td>
<td valign="middle" align="left"><br><input id="02 - EMAIL:" name="02 - EMAIL:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "02 - EMAIL:"</script></td>
</tr>
<tr>
<td background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*CONFIRM<br>EMAIL:</font></td>
<td valign="middle" align="left"><br><input id="03 - CONFIRM EMAIL:" name="03 - CONFIRM EMAIL:" value="" size="50" type="input"><script type="text/javascript">reqArr[reqArr.length] = "03 - CONFIRM EMAIL:"</script></td>
</tr>
<tr>
<td valign="top" background="images/©sandybgrd.gif"><br><font color="#993300" size="3">*YOUR<br>QUERY:</font></td>
<td valign="middle" align="left"><br><textarea id="04 - YOUR QUERY:" name="04 - YOUR QUERY:" rows="5" cols="37"></textarea><script type="text/javascript">reqArr[reqArr.length] = "04 - YOUR QUERY:"</script>
<br>
<div align="center>
<p align="left"><input onclick="if (!validate(form)) return; form.submit();" value="CLICK TO SUBMIT " name="05 - CLICK TO SUBMIT " type="button">
<input value="RESET" name="reset" type="reset" type="button"> </p></div></td>
</tr>
</table>
</form>