|
jimminko -> RE: SQL injection (3/11/2008 9:40:41)
|
Sorry. Thanks for the help - if I can understand how it works on this one, I can apply it to my other pages. Here's the wprdbrief.asp code:
<tbody>
<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM qryWorddescription WHERE (HeadwordID = ::HeadwordID::)"
fp_sDefault="HeadwordID="
fp_sNoRecords="<tr><td colspan=9 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Database2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Greekword"
fp_sMenuValue="Greekword"
fp_iDisplayCols=9
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td height="24"><span class="grk"><FONT size="4">
<%=FP_FieldVal(fp_rs,"Greekword")%></font></SPAN></td>
<td height="24" colspan="3"></td>
</tr>
<tr>
<td height="24" valign="top" bgcolor="#FFFF99" >
<b>Grammar</b></td>
<td height="24" valign="top" WIDTH="300">
<%=FP_FieldVal(fp_rs,"Gramtype")%>
<%=FP_FieldVal(fp_rs,"Gramsubclass")%>
<%=FP_FieldVal(fp_rs,"Declension")%></td>
</tr>
<tr>
<td height="22" valign="top" bgcolor="#FFFF99">
<b>Features</b></td>
<td height="22" colspan="3" valign="top">
<%=FP_FieldVal(fp_rs,"Neologism")%>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0">
</td>
</tr>
<tr>
<td height="30" valign="top" bgcolor="#FFFF99">
<b>Status</b></td>
<td height="21" colspan="3" valign="top">
<%=FP_FieldVal(fp_rs,"Status")%> <%=FP_FieldVal(fp_rs,"Personsurname")%>
</td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#C0C0C0">
<font face="Verdana" size="2">
<a href="booklist.asp?HeadwordID=<%=FP_FieldURL(fp_rs,"HeadwordID")%>">Bibliography</a></font></td>
<td height="25" colspan="3">
<FONT size="2"><I>Last updated:</I>
<%=FP_FieldVal(fp_rs,"Lastupdated")%></FONT></td>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>
<TABLE border="1" style="border-collapse: collapse" bordercolor="#111111" cellpadding="5" cellspacing="0" ALIGN="left">
<THEAD>
<TR>
<TD bgcolor="#FFFF99"><B>Morph category</B></TD>
<TD bgcolor="#FFFF99"><B>Morphology</B></TD>
</TR>
</THEAD>
<TBODY>
<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT DISTINCT Morphcategory, Morphology FROM qryMorphology WHERE (HeadwordID = ::HeadwordID::)"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">No data entered.</td></tr>"
fp_sDataConn="Database2"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<TR>
<TD height="24">
<%=FP_FieldVal(fp_rs,"Morphcategory")%> </TD>
<TD><SPAN CLASS="grk">
<%=FP_FieldVal(fp_rs,"Morphology")%> </SPAN></TD>
</TR>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</TBODY>
</TABLE>
<TABLE border="1" style="border-collapse: collapse" bordercolor="#111111" cellpadding="5" cellspacing="0" ALIGN="left" height="49">
<THEAD>
<TR>
<TD bgcolor="#FFFF99" height="8"><B>Occurrences</B></TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD height="20">
<%
test = "SELECT DISTINCT Count(*) AS TotalCount FROM qrySources WHERE HeadwordID="& Request("HeadwordID")
Set myConn = Server.CreateObject("ADODB.Connection")
myPath = Application("Database2_ConnectionString")
myConn.Open myPath
mySQL = test
Set myRS = Server.CreateObject("ADODB.RecordSet")
myRS.Open mySQL, myConn
FirstValue = myRS("TotalCount")
myRS.Close
Set myRS = Nothing
myConn.Close
Set myConn = Nothing
response.write (FirstValue)
%> </TD>
</TR>
</TBODY>
|
|
|
|