|
ttjager -> RE: DB update form confirmation page (10/12/2005 14:27:56)
|
I noticed something when copying the code for this reply. When I change the line: Response.Redirect "details_thoughts_input_confirm.asp" to Response.Redirect "details_thoughts_input_confirm.asp?ID="&Request.QueryString("ID") as Duane suggested, everything looks fine after I save it. However, when I close the file and reopen it, the line still reads: Response.Redirect "details_thoughts_input_confirm.asp Here is ALL the code for details_thoughts_input.asp:
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
Err.Clear
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("memorial_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "thoughts", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(3)
Dim arFormDBFields0(3)
Dim arFormValues0(3)
arFormFields0(0) = "thought"
arFormDBFields0(0) = "thought"
arFormValues0(0) = Request("thought")
arFormFields0(1) = "ID"
arFormDBFields0(1) = "ID"
arFormValues0(1) = Request("ID")
arFormFields0(2) = "name"
arFormDBFields0(2) = "name"
arFormValues0(2) = Request("name")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
FP_SaveFieldToDB fp_rs, Now, "date"
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
Response.Redirect "details_thoughts_input_confirm.asp"
End If
End If
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="../memorial.css">
<title>ALEA - Fallen Hero Memorial - Thoughts & Memories Input Form</title>
</head>
<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0">
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%">
<!--webbot bot="Include" U-Include="../includes/memorial_mast.htm" TAG="BODY" --></td>
</tr>
<tr>
<td width="100%" valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="550" id="AutoNumber2">
<tr>
<td width="100%">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="550" id="AutoNumber3">
<tr>
<td width="15" height="30">
<img border="0" src="images/box/upper_left.jpg"></td>
<td height="30" background="images/box/top.jpg"></td>
<td width="15" height="30">
<img border="0" src="images/box/upper_right.jpg"></td>
</tr>
<tr>
<td width="15" background="images/box/left.jpg"></td>
<td>
<!--#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 names WHERE (ID = ::ID::) ORDER BY lastname ASC,firstname ASC"
fp_sDefault="ID="
fp_sNoRecords="No records returned."
fp_sDataConn="memorial"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="date"
fp_sMenuValue="date"
fp_sColTypes="&ID=3&date=135&lastname=202&firstname=202&agency=203&state=202&aircraft=202&details=203&link=202&photo=202&patch=202&reviewed=11&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="475" id="AutoNumber4">
<tr>
<td width="475" colspan="3">
<p align="center">
<b>
<i>In Memory Of</i></b></p>
<h1 align="center">
<b>
<%=FP_FieldVal(fp_rs,"firstname")%>
<%=FP_FieldVal(fp_rs,"lastname")%></b></h1>
<h2 align="center">
<span style="font-style: normal">
<%=FP_FieldVal(fp_rs,"agency")%>,
<%=FP_FieldVal(fp_rs,"state")%><br>
End of watch:
<%=FP_FieldVal(fp_rs,"date")%><br>
Aircraft:
<%=FP_FieldVal(fp_rs,"aircraft")%></span></h2>
</td>
</tr>
<tr>
<td width="237">
<div align="right">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber6">
<tr>
<td width="5" height="5">
<img border="0" src="images/photo_box/upper_left.jpg"></td>
<td height="5" background="images/photo_box/top.jpg"></td>
<td width="12" height="5">
<p align="right">
<img border="0" src="images/photo_box/upper_right.jpg"></td>
</tr>
<tr>
<td width="5" background="images/photo_box/left.jpg"></td>
<td width="100" height="125" background="images/photo_box/spacer.gif">
<p align="center">
<img border="0" src="images/heros/<%=FP_FieldLink(fp_rs,"photo")%>"></td>
<td width="12" background="images/photo_box/right.jpg"></td>
</tr>
<tr>
<td width="5" height="13">
<img border="0" src="images/photo_box/lower_left.jpg"></td>
<td background="images/photo_box/bottom.jpg" height="13"></td>
<td width="12" height="13">
<img border="0" src="images/photo_box/lower_right.jpg"></td>
</tr>
</table>
</div>
</td>
<td width="9">
</td>
<td width="229">
<img border="0" src="images/patches/<%=FP_FieldLink(fp_rs,"patch")%>" align="left"></td>
</tr>
</table>
</center>
</div>
<h3 align="center"><span style="font-weight: 400">Leave your Thoughts or Memories
of </span>
<b>
<span style="font-weight: 400">
<%=FP_FieldVal(fp_rs,"firstname")%></span>
<span style="font-weight: 400">
<%=FP_FieldVal(fp_rs,"lastname")%>.</span></b></h3>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
<table border="0" cellpadding="10" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber7">
<tr>
<td width="100%">
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" suggestedext="asp" u-asp-include-url="../_fpclass/fpdbform.inc" s-dataconnection="memorial" s-recordsource="thoughts" u-database-url="../fpdb/memorial.mdb" u-confirmation-url="details_thoughts_input_confirm.asp" s-builtin-fields="Timestamp" s-builtin-dbfields="date" s-form-fields="thought ID name" s-form-dbfields="thought ID name" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="34604" --><p>
Your Name (may be left anonymous):<br>
<input type="text" name="name" size="35" value="anonymous"></p>
<p>Your Thoughts or Memories of this fallen hero:<br>
<textarea rows="10" name="thought" cols="56"></textarea><br>
</p>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
<input type="hidden" name="ID" value="<%=Request.querystring("ID")%>">
</form>
<p> </td>
</tr>
</table>
</td>
<td width="15" background="images/box/right.jpg"> </td>
</tr>
<tr>
<td width="15" height="17">
<img border="0" src="images/box/lower_left.jpg"></td>
<td height="17" background="images/box/bottom.jpg"> </td>
<td width="15" height="17">
<img border="0" src="images/box/lower_right.jpg"></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
<tr>
<td width="100%">
<p align="justify"><br>
Do you have more information about this fallen
hero? Help us maintain an accurate and fitting tribute to the men and
women who have made the ultimate sacrifice.
<a href="http://www.alea.org/public/memorial/updates/update_form.htm">Please provide us with
corrections and/or additional information</a>.</p>
</td>
</tr>
</table>
</center>
</div>
<p> </td>
</tr>
<tr>
<td width="100%">
<!--webbot bot="Include" U-Include="../includes/copyrights_footer.htm" TAG="BODY" --></td>
</tr>
</table>
</body>
</html>
Todd
|
|
|
|