我被迫在这个项目中使用 Classic ASP,并且在大多数情况下它对我来说并没有真正成为问题,直到现在。我不熟悉 ASP,我想做的只是创建一个简单的联系表格。这是我的标记:
<form method="post" action="contactform_submit.asp">
<ol class="formset" style="padding: 0px; margin: 0px;">
<li><label for="mbr-y">Are you currently a Walser Rewards Member?</label> <input class="mbr-yn" style="height: 13px; width: 13px" type="radio" name="mbr-y" value="Yes" /> Yes <input class="mbr-yn" style="height: 13px; width: 13px" type="radio" name="mbr-n" value="No" /> No</li>
<li><label for="fname">Full Name: </label><input id="fname" required="-1" name="fname" type="text" />
<ol id="member" class="formset" style="padding:0px; margin: 0px;">
<li><label for="mbrnum">Member Number: </label><input id="mbrnum" name="mbrnum" type="text" /></li>
</ol>
</li>
<li><label for="lname2">Phone Number: </label><input id="phone" name="phone" type="text" /></li>
<li><label for="email2">Email Address: </label><input id="email" name="email" type="text" /></li>
<li><label for="message">Message: </label><textarea id="message" required="-1" value="" type="text" name="message"></textarea></li>
</ol>
<input style="height: 33px; padding: 0px; margin-top: 7px; width: 120px;" src="/image/walsergold/send-btn.jpg" type="image" />
</form>
我做了一些研究,但我很难解释 ASP 和 HTML 是如何交互的。我希望如果人们在谈论我的标记,我会更容易理解。有人能指出“contactform_submit.asp”的正确方向吗?谢谢你。
编辑:根据我的研究,我为“contactform_submit.asp”想出了这个(它不起作用):
<%
Dim mail, body
body = "Current Member: " & Request.Form("mbr-yn") & vbcrlf & vbcrlf & "Member Name: " & Request.Form("fname") & vbcrlf & vbcrlf & "Member Number: " & Request.Form("mbrnum") & vbcrlf & vbcrlf & "Phone: " & Request.Form("phone") & vbcrlf & vbcrlf & "Email: " & Request.Form("email") & vbcrlf & vbcrlf & "Message: " & Request.Form("message")
Set mail = Server.CreateObject("CDO.Message")
mail.To = "email@address.com"
mail.From = "email@address.com"
mail.Subject = "Online Contact Form"
mail.TextBody = body
mail.Send()
Response.Write("Thanks for submitting the feedback. A Customer Service Specialist will be in contact with you shortly.")
Set mail = nothing
Set body = nothing
%>