J
jon
Hi,
I've created a page, that looks up a URL form my database depending on a
value "LINK_ID" thats passed in the url.
If the user amends the LINK_ID=1 in the url to LINK_ID=9999 ( or any other
ID that isnt in my database) then I want to redirect them to a different
page. (Im using a hosted package and I cant edit the error pages).
Heres my ASP, can anyone show me how to do this ?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/DataLinks.asp" -->
<%
Dim Get_Destination__MMColParam
Get_Destination__MMColParam = "1"
If (Request.QueryString("Link_ID") <> "") Then
Get_Destination__MMColParam = Request.QueryString("Link_ID")
End If
%>
<%
Dim Get_Destination
Dim Get_Destination_numRows
Set Get_Destination = Server.CreateObject("ADODB.Recordset")
Get_Destination.ActiveConnection = MM_DataLinks_STRING
Get_Destination.Source = "SELECT * FROM TBL_LINKS WHERE Link_No = " +
Replace(Get_Destination__MMColParam, "'", "''") + ""
Get_Destination.CursorType = 0
Get_Destination.CursorLocation = 2
Get_Destination.LockType = 1
Get_Destination.Open()
Get_Destination_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<% Response.Redirect ((Get_Destination.Fields.Item("Link_path").Value)) %>
</body>
</html>
<%
Get_Destination.Close()
Set Get_Destination = Nothing
%>
Thanks
Jon
I've created a page, that looks up a URL form my database depending on a
value "LINK_ID" thats passed in the url.
If the user amends the LINK_ID=1 in the url to LINK_ID=9999 ( or any other
ID that isnt in my database) then I want to redirect them to a different
page. (Im using a hosted package and I cant edit the error pages).
Heres my ASP, can anyone show me how to do this ?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/DataLinks.asp" -->
<%
Dim Get_Destination__MMColParam
Get_Destination__MMColParam = "1"
If (Request.QueryString("Link_ID") <> "") Then
Get_Destination__MMColParam = Request.QueryString("Link_ID")
End If
%>
<%
Dim Get_Destination
Dim Get_Destination_numRows
Set Get_Destination = Server.CreateObject("ADODB.Recordset")
Get_Destination.ActiveConnection = MM_DataLinks_STRING
Get_Destination.Source = "SELECT * FROM TBL_LINKS WHERE Link_No = " +
Replace(Get_Destination__MMColParam, "'", "''") + ""
Get_Destination.CursorType = 0
Get_Destination.CursorLocation = 2
Get_Destination.LockType = 1
Get_Destination.Open()
Get_Destination_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<% Response.Redirect ((Get_Destination.Fields.Item("Link_path").Value)) %>
</body>
</html>
<%
Get_Destination.Close()
Set Get_Destination = Nothing
%>
Thanks
Jon