form_ac.asp,但返回到"Thanks.html"页 [英] form_ac.asp but return to a "Thanks.html" page

查看:84
本文介绍了form_ac.asp,但返回到"Thanks.html"页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是一个初学者,我在Fasthosts服务器上使用"form.html"和"form_ac.asp"代码,可以正常工作,但我想让它返回到谢谢"按下提交按钮后的".html"页面,而不是已发送电子邮件"消息.我必须添加些什么才能实现此目的.
谢谢
卡罗尔·哈蒙德

我正在使用的代码如下:-

I''m just a beginner and I''m using the "form.html" and "form_ac.asp" code on my Fasthosts server which works fine but I''d like to have it return to a "Thanks.html" page after the submit button is pressed instead of the "email has been sent" message. What do I have to add to achieve this.
Thanks
Carol Harmond

The code I''m using is as follows:-

<%@ Language="VBscript" %>
<% Option Explicit %>

<html>
<head>
<title>Message Sent</title>
</head>

<body>
<%
'declare the variables that will receive the values
'receive the values sent from the form and assign them to variables
'note that request.form("name") will receive the value entered into the textfield
'called name, and so with email and message
Dim name, email, rin, message, NewMailObj
name=request.form("name")
email=request.form("email")
rin=request.form("rin")
message=request.form("message")

'create the mail object and send the details
Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
NewMailObj.From = "mysite@mysite.com"
NewMailObj.To = "me@mysite.com"
NewMailObj.Subject = "New message sent.."
NewMailObj.Body = "the name entered was " & name & _
"<br>the email was " & email & _
"<br>the rin was " & rin & _
"<br>the message was:- <br> " & message

'you need to add the following lines FOR the mail to be sent in HTML format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
NewMailObj.Send
'Close the email object and free up resources
Set NewMailObj = nothing
Response.write "The email was sent, please use your back button to continue."
%>

</body>
</html>

推荐答案

您需要执行Response.Redirect而不是Response.Write.

在此处查看: ASP重定向方法 [
You need to do a Response.Redirect instead of Response.Write.

Have a look at it here: ASP Redirect Method[^]


这篇关于form_ac.asp,但返回到"Thanks.html"页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆