I have a page that autosubmits an email.
However I need to check the email address is there and then redirect the user if it is missing from the database, if the email address is missing then no email is to be sent.
This works fine with the code I have but once the condition is met ie no email address the page does not redirect but appears to loop in the Onload bit of javascript code.
I have posted this in the Ultradev Forum as well, because in case you didnt guess that is how I have made most of it although the Redirect bit is hand coded in.
The whole script is below any help is greatly appreciated.
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsEmail__MMColParam
rsEmail__MMColParam = "1"
if(Request.QueryString("stage" <> "" then rsEmail__MMColParam = Request.QueryString("stage"
%> <%
set rsEmail = Server.CreateObject("ADODB.Recordset"
rsEmail.ActiveConnection = "dsn=sku_tracking;"
rsEmail.Source = "SELECT * FROM tbl_email WHERE stage = " + Replace(rsEmail__MMColParam, "'", "''" + ""
rsEmail.CursorType = 0
rsEmail.CursorLocation = 2
rsEmail.LockType = 3
rsEmail.Open
rsEmail_numRows = 0
'
'Check the Email address is there and redirect if not
'
strEmailAdd = rsEmail.Fields.Item("email_address".Value
If strEmailAdd = "" Then
Response.Redirect "admin_sku_master.asp"
End If
'
'Build the mailto string
'
strSKU = (Request.QueryString("passedSKU")
strMailto = ("mailto:" + rsEmail.Fields.Item("email_address".Value + "?subject=" + strSKU + "&body=" + rsEmail.Fields.Item("email_text".Value)
%>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function autosubmit() {
document.form1.submit ()
}
onload=autosubmit;
</SCRIPT>
</head>
<body>
<form name="form1" method="post" action="<%=strMailto%>">
</form>
<p><a href="admin_sku_master.asp">Click here</a> to return to the Master page.
</body>
</html>
I dont want to go to Chelsea!!!
However I need to check the email address is there and then redirect the user if it is missing from the database, if the email address is missing then no email is to be sent.
This works fine with the code I have but once the condition is met ie no email address the page does not redirect but appears to loop in the Onload bit of javascript code.
I have posted this in the Ultradev Forum as well, because in case you didnt guess that is how I have made most of it although the Redirect bit is hand coded in.
The whole script is below any help is greatly appreciated.
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsEmail__MMColParam
rsEmail__MMColParam = "1"
if(Request.QueryString("stage" <> "" then rsEmail__MMColParam = Request.QueryString("stage"
%> <%
set rsEmail = Server.CreateObject("ADODB.Recordset"
rsEmail.ActiveConnection = "dsn=sku_tracking;"
rsEmail.Source = "SELECT * FROM tbl_email WHERE stage = " + Replace(rsEmail__MMColParam, "'", "''" + ""
rsEmail.CursorType = 0
rsEmail.CursorLocation = 2
rsEmail.LockType = 3
rsEmail.Open
rsEmail_numRows = 0
'
'Check the Email address is there and redirect if not
'
strEmailAdd = rsEmail.Fields.Item("email_address".Value
If strEmailAdd = "" Then
Response.Redirect "admin_sku_master.asp"
End If
'
'Build the mailto string
'
strSKU = (Request.QueryString("passedSKU")
strMailto = ("mailto:" + rsEmail.Fields.Item("email_address".Value + "?subject=" + strSKU + "&body=" + rsEmail.Fields.Item("email_text".Value)
%>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function autosubmit() {
document.form1.submit ()
}
onload=autosubmit;
</SCRIPT>
</head>
<body>
<form name="form1" method="post" action="<%=strMailto%>">
</form>
<p><a href="admin_sku_master.asp">Click here</a> to return to the Master page.
</body>
</html>
I dont want to go to Chelsea!!!