Here is the ASP code I have:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/highmightynews.asp" -->
<%
Dim news__weekn
news__weekn = "2"
if (request.querystring("Week"
<> ""
then news__weekn = request.querystring("Week"
%>
<%
set news = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
news.ActiveConnection = MM_highmightynews_STRING
news.Source = "SELECT * FROM Main WHERE Week=" + Replace(news__weekn, "'", "''"
+ " and category = '1'"
news.CursorType = 0
news.CursorLocation = 2
news.LockType = 3
news.Open()
news_numRows = 0
%>
<%
Dim offers__weekn
offers__weekn = "1"
if (request.querystring("Week"
<> ""
then offers__weekn = request.querystring("Week"
%>
<%
set offers = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
offers.ActiveConnection = MM_highmightynews_STRING
offers.Source = "SELECT * FROM Main WHERE Week=" + Replace(offers__weekn, "'", "''"
+ " and category = '2'"
offers.CursorType = 0
offers.CursorLocation = 2
offers.LockType = 3
offers.Open()
offers_numRows = 0
%>
<%
Dim cat3__weekn
cat3__weekn = "1"
if (request.querystring("Week"
<> ""
then cat3__weekn = request.querystring("Week"
%>
<%
set cat3 = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
cat3.ActiveConnection = MM_highmightynews_STRING
cat3.Source = "SELECT * FROM Main WHERE Week=" + Replace(cat3__weekn, "'", "''"
+ " and category = '3'"
cat3.CursorType = 0
cat3.CursorLocation = 2
cat3.LockType = 3
cat3.Open()
cat3_numRows = 0
%>
<%
Dim cat4__weekn
cat4__weekn = "1"
if (request.querystring("Week"
<> ""
then cat4__weekn = request.querystring("Week"
%>
<%
set cat4 = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
cat4.ActiveConnection = MM_highmightynews_STRING
cat4.Source = "SELECT * FROM Main WHERE Week=" + Replace(cat4__weekn, "'", "''"
+ " and category = '4'"
cat4.CursorType = 0
cat4.CursorLocation = 2
cat4.LockType = 3
cat4.Open()
cat4_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a { font-family: Verdana; font-size: 12px; color: #000000}
p { font-family: Verdana; font-size: 12px; color: #000000}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function viewSource() {
document.getSource.view.value="Please wait!";
setTimeout("document.getSource.view.value='View Source!'",6000);
window.location.href= "view-source:" + document.location.url.value;
return false;
}
function openbrochure(windowurl) {
brochurewindow = window.open(windowurl, "brochurewindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=550,height=290"
;
brochurewindow.focus();
}
function openterms(windowurl) {
termswindow = window.open(windowurl, "termswindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=350,height=276"
;
termswindow.focus();
}
function Opensizing(windowurl) {
sizingwindow = window.open(windowurl, "sizingwindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=400,height=410"
;
sizingwindow.focus();
}
function Opencontact(windowurl) {
contact = window.open(windowurl,"contact","scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=550,height=400"
;
contact.focus();
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById
; return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
if (val) { nm=val.name; if ((val=val.value)!=""
{
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
// End -->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="545" valign="top">
<table width="84%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src=" width="800" height="60"></td>
</tr>
</table>
<table width="800" border="0" cellspacing="0" cellpadding="0" height="324">
<tr>
<td bgcolor="#DACFCB" width="100" valign="top" height="252">
<p align="center"><br>
Issue
<% If Not news.EOF Or Not news.BOF Then %>
<%=(news.Fields.Item("Week"
.Value)%>
<% End If ' end Not offers.EOF Or NOT offers.BOF %>
<br>
<% If news.EOF And news.BOF Then %>
No Issue to display
<% End If ' end offers.EOF And offers.BOF %>
</p>
<table width="99%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="100%">
<p><a href=" face="Arial, Helvetica, sans-serif">Special
Offer</font></a></p>
<p><font face="Arial, Helvetica, sans-serif"><a href=" <p><font face="Arial, Helvetica, sans-serif"><a href=" Us</a></font></p>
</td>
</tr>
</table>
</td>
<td height="252" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#DACFCB"><font color="#003399" face="Arial, Helvetica, sans-serif">
</font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<p> </p>
<table width="100%" border="0" cellspacing="0" cellpadding="5" height="77">
<tr>
<td width="217" valign="top">
<% If news.EOF And news.BOF Then %>
<p>Please make sure you have entered a value for category
1</p>
<% End If ' end news.EOF And news.BOF %>
<% If Not news.EOF Or Not news.BOF Then %>
<p><%=(news.Fields.Item("Title"
.Value)%></p>
<p><%=(news.Fields.Item("Content"
.Value)%></p>
<% End If ' end Not news.EOF Or NOT news.BOF %>
</td>
<td width="217" valign="top">
<% If offers.EOF And offers.BOF Then %>
<p>Please make sure you have entered a value for category
2</p>
<% End If ' end offers.EOF And offers.BOF %>
<% If Not offers.EOF Or Not offers.BOF Then %>
<p><%=(offers.Fields.Item("Title"
.Value)%></p>
<p><%=(offers.Fields.Item("Content"
.Value)%></p>
<% End If ' end Not offers.EOF Or NOT offers.BOF %>
</td>
</tr>
</table>
<div align="left"></div>
<table width="100%
" border="0" cellspacing="0" cellpadding="5" height="77" align="left">
<tr>
<td width="150" valign="top">
<% If cat3.EOF And cat3.BOF Then %>
<p>Please make sure you have entered a value for category
3</p>
<% End If ' end cat3.EOF And cat3.BOF %>
<% If Not cat3.EOF Or Not cat3.BOF Then %>
<p><%=(cat3.Fields.Item("Title"
.Value)%></p>
<p> <%=(cat3.Fields.Item("Content"
.Value)%></p>
<% End If ' end Not cat3.EOF Or NOT cat3.BOF %>
</td>
<td width="150" valign="top">
<% If cat4.EOF And cat4.BOF Then %>
<p>Please make sure you have entered a value for category
4</p>
<% End If ' end cat4.EOF And cat4.BOF %>
<% If Not cat4.EOF Or Not cat4.BOF Then %>
<p><%=(cat4.Fields.Item("Title"
.Value)%></p>
<p><%=(cat4.Fields.Item("Content"
.Value)%></p>
<% End If ' end Not cat4.EOF Or NOT cat4.BOF %>
</td>
</tr>
</table>
<p> </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="151" valign="middle"><a href=" target=-"_blank"><img src=" width="41" height="50" border="0"></a> <a href=" target="_blank"><img src=" width="80" height="50" border="0"></a></td>
<td align="center" width="690"><font face="garamond" color="#0E1F87" size="-1"><a href="javascript
penbrochure(' Brochure</a> - <a href="javascript
penterms(' and Conditions</a> - <a href="javascript:Opensizing(' Sizing</a> - <a href=" target="main">About
Us</a> - <a href=" target="main">Where
are we?</a> - <a href="javascript:Opencontact(' Us</a></font></td>
<td align="center" width="65" valign="bottom"><img src=" width="187" height="25" align="bottom"></td>
<td width="71" align="center">
<div align="right">
<table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center'><a href=' target="_blank"><img src=' border='0'></a></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<p>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
<%
news.Close()
%>
<%
offers.Close()
%>
<%
cat3.Close()
%>
<%
cat4.Close()
%>
Just a quick uestion, how do I convert the actual DB extracted values to HTML to send as an e-mail.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/highmightynews.asp" -->
<%
Dim news__weekn
news__weekn = "2"
if (request.querystring("Week"
%>
<%
set news = Server.CreateObject("ADODB.Recordset"
news.ActiveConnection = MM_highmightynews_STRING
news.Source = "SELECT * FROM Main WHERE Week=" + Replace(news__weekn, "'", "''"
news.CursorType = 0
news.CursorLocation = 2
news.LockType = 3
news.Open()
news_numRows = 0
%>
<%
Dim offers__weekn
offers__weekn = "1"
if (request.querystring("Week"
%>
<%
set offers = Server.CreateObject("ADODB.Recordset"
offers.ActiveConnection = MM_highmightynews_STRING
offers.Source = "SELECT * FROM Main WHERE Week=" + Replace(offers__weekn, "'", "''"
offers.CursorType = 0
offers.CursorLocation = 2
offers.LockType = 3
offers.Open()
offers_numRows = 0
%>
<%
Dim cat3__weekn
cat3__weekn = "1"
if (request.querystring("Week"
%>
<%
set cat3 = Server.CreateObject("ADODB.Recordset"
cat3.ActiveConnection = MM_highmightynews_STRING
cat3.Source = "SELECT * FROM Main WHERE Week=" + Replace(cat3__weekn, "'", "''"
cat3.CursorType = 0
cat3.CursorLocation = 2
cat3.LockType = 3
cat3.Open()
cat3_numRows = 0
%>
<%
Dim cat4__weekn
cat4__weekn = "1"
if (request.querystring("Week"
%>
<%
set cat4 = Server.CreateObject("ADODB.Recordset"
cat4.ActiveConnection = MM_highmightynews_STRING
cat4.Source = "SELECT * FROM Main WHERE Week=" + Replace(cat4__weekn, "'", "''"
cat4.CursorType = 0
cat4.CursorLocation = 2
cat4.LockType = 3
cat4.Open()
cat4_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a { font-family: Verdana; font-size: 12px; color: #000000}
p { font-family: Verdana; font-size: 12px; color: #000000}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function viewSource() {
document.getSource.view.value="Please wait!";
setTimeout("document.getSource.view.value='View Source!'",6000);
window.location.href= "view-source:" + document.location.url.value;
return false;
}
function openbrochure(windowurl) {
brochurewindow = window.open(windowurl, "brochurewindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=550,height=290"
brochurewindow.focus();
}
function openterms(windowurl) {
termswindow = window.open(windowurl, "termswindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=350,height=276"
termswindow.focus();
}
function Opensizing(windowurl) {
sizingwindow = window.open(windowurl, "sizingwindow" ,"scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=400,height=410"
sizingwindow.focus();
}
function Opencontact(windowurl) {
contact = window.open(windowurl,"contact","scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no,directories=no,width=550,height=400"
contact.focus();
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
if (val) { nm=val.name; if ((val=val.value)!=""
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
// End -->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="545" valign="top">
<table width="84%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src=" width="800" height="60"></td>
</tr>
</table>
<table width="800" border="0" cellspacing="0" cellpadding="0" height="324">
<tr>
<td bgcolor="#DACFCB" width="100" valign="top" height="252">
<p align="center"><br>
Issue
<% If Not news.EOF Or Not news.BOF Then %>
<%=(news.Fields.Item("Week"
<% End If ' end Not offers.EOF Or NOT offers.BOF %>
<br>
<% If news.EOF And news.BOF Then %>
No Issue to display
<% End If ' end offers.EOF And offers.BOF %>
</p>
<table width="99%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="100%">
<p><a href=" face="Arial, Helvetica, sans-serif">Special
Offer</font></a></p>
<p><font face="Arial, Helvetica, sans-serif"><a href=" <p><font face="Arial, Helvetica, sans-serif"><a href=" Us</a></font></p>
</td>
</tr>
</table>
</td>
<td height="252" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#DACFCB"><font color="#003399" face="Arial, Helvetica, sans-serif">
</font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<p> </p>
<table width="100%" border="0" cellspacing="0" cellpadding="5" height="77">
<tr>
<td width="217" valign="top">
<% If news.EOF And news.BOF Then %>
<p>Please make sure you have entered a value for category
1</p>
<% End If ' end news.EOF And news.BOF %>
<% If Not news.EOF Or Not news.BOF Then %>
<p><%=(news.Fields.Item("Title"
<p><%=(news.Fields.Item("Content"
<% End If ' end Not news.EOF Or NOT news.BOF %>
</td>
<td width="217" valign="top">
<% If offers.EOF And offers.BOF Then %>
<p>Please make sure you have entered a value for category
2</p>
<% End If ' end offers.EOF And offers.BOF %>
<% If Not offers.EOF Or Not offers.BOF Then %>
<p><%=(offers.Fields.Item("Title"
<p><%=(offers.Fields.Item("Content"
<% End If ' end Not offers.EOF Or NOT offers.BOF %>
</td>
</tr>
</table>
<div align="left"></div>
<table width="100%
" border="0" cellspacing="0" cellpadding="5" height="77" align="left">
<tr>
<td width="150" valign="top">
<% If cat3.EOF And cat3.BOF Then %>
<p>Please make sure you have entered a value for category
3</p>
<% End If ' end cat3.EOF And cat3.BOF %>
<% If Not cat3.EOF Or Not cat3.BOF Then %>
<p><%=(cat3.Fields.Item("Title"
<p> <%=(cat3.Fields.Item("Content"
<% End If ' end Not cat3.EOF Or NOT cat3.BOF %>
</td>
<td width="150" valign="top">
<% If cat4.EOF And cat4.BOF Then %>
<p>Please make sure you have entered a value for category
4</p>
<% End If ' end cat4.EOF And cat4.BOF %>
<% If Not cat4.EOF Or Not cat4.BOF Then %>
<p><%=(cat4.Fields.Item("Title"
<p><%=(cat4.Fields.Item("Content"
<% End If ' end Not cat4.EOF Or NOT cat4.BOF %>
</td>
</tr>
</table>
<p> </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="151" valign="middle"><a href=" target=-"_blank"><img src=" width="41" height="50" border="0"></a> <a href=" target="_blank"><img src=" width="80" height="50" border="0"></a></td>
<td align="center" width="690"><font face="garamond" color="#0E1F87" size="-1"><a href="javascript
Us</a> - <a href=" target="main">Where
are we?</a> - <a href="javascript:Opencontact(' Us</a></font></td>
<td align="center" width="65" valign="bottom"><img src=" width="187" height="25" align="bottom"></td>
<td width="71" align="center">
<div align="right">
<table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center'><a href=' target="_blank"><img src=' border='0'></a></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<p>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
<%
news.Close()
%>
<%
offers.Close()
%>
<%
cat3.Close()
%>
<%
cat4.Close()
%>
Just a quick uestion, how do I convert the actual DB extracted values to HTML to send as an e-mail.