I have an Access database that I have web enabled using ASP, everything
works fine except for one thing. Let me start by giving a background of
the requirements.
This is an online obituary database for a funeral home, I have 4 ASP
pages; obits.asp (displays records from a table in the DB),
DBInputFormc.ASP (used to input condolences into another table same
db), Condolences.ASP (Displays records from the condolences table in
the DB), and Thankyou.ASP (posts data from the DBInputFormc.asp page to
the condolences table in the DB).
My problem is, I want to be able for the visitors to be able to click
on the deceased name on the obits.asp page and open the
DBInputformc.asp page to leave thier condolences without having to
enter the deceased name on the form. ( i.e. want to pass the deceased
name from obits.asp to DBInputFormc.asp then post it to the db. Also
they should be able to view the condolences for the deceased by
clicking on their name from the obits.asp page. Below is the code for
each page, the live site can be viewed at www.davisfuneral-chapel.com,
any assistance would be appreciated.
(Obits.ASP)
<% Response.Buffer = True %>
<html>
<head>
<title>Davis Funeral Chapel Obituaries</title>
</head>
<body>
<BODY BGCOLOR="white" bgproperties="fixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">Obituaries</font>
<center>Click <a href="condolences.asp">here</a> to view the guestbook
for all condolences.</center>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")
rs.Open "deceased", "DSN=condolences.dsn"
While Not rs.EOF
Response.Write "Name: " & rs("firstname") & " " &
rs("lastname") & " " & "<a href=DBInputFormc.asp>Send Condolences</a>"
& "<br>"
Response.Write "Date of Birth: " & rs("DOB") & "<br>"
Response.Write "Date of Death: " & rs("DOD") & "<br>"
Response.Write rs("picture") & "<br>"
Response.Write "Obituary: " & rs("obituary") & "<hr>" & "<br>"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
%>
</BODY>
</HTML>
(DBInputFormc.asp)
<html>
<head>
<title>Condolences</title>
</head>
<body bgcolor="white">
<center><b><font face="Times New Roman"><b><font size="+2"
color="#009933">Please send your
condolences to the family</font></b></font></center><BR>
<font face="times new roman" size="4"></b>
<center>
Information submitted will be listed on the condolences registry and
given to the family<br>
It will not be used for any other purpose.</i></font><BR>
Please complete all blanks, if you do not have an email address simply
enter
"none"</center><br>
<hr size=2 color="#B54039">
<font face="arial" size="3">
<form method="post" action="thankyou.asp">
<b>From:</B><br>
First Name:<input type="text" name="fname" size="20"><br>
Last Name:<input type="text" name="lname" size="20"><br>
Address:    <input type="text" name="staddress"
size="45"><br>
City:             <input
type="text" name="city" size="20"><br>
State:        &nbs p <input
type="text"
name="state" size="15"><br>
Zip:         & nbsp    <input
type="text"
name="zip" size="20"><br>
Email:         <input type="text" name="email"
size="25"><br>
Condolences:<TEXTAREA NAME="condolences" ROWS=6
COLS=60></TEXTAREA><br>
<center><input type="submit" value="Submit!"><br><br></b></center>
</font>
</form>
</body>
</html>
(condolences.asp)
<% Response.Buffer = True %>
<html>
<head>
<title>Davis Funeral Chapel Condolences</title>
</head>
<body>
<BODY BGCOLOR="white" bgproperties="fixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">Condolences</font>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")
rs.Open "condolences", "DSN=condolences.dsn"
While Not rs.EOF
Response.Write "For the family of: " & rs("firstname") & " "
& rs("lastname") & "<br>"
Response.Write "From: " & rs("fname") & " " & rs("lname") & "<br>"
Response.Write "Address:" & rs("staddress") & "<br>"
Response.Write "" & rs("city") & " " & rs("state") & " " & rs("zip")&
"<br>"
Response.Write "Email: " & rs("email") & "<br>"
Response.Write "Condolences: " & rs("condolences") & "<hr>" & "<br>"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
%>
</BODY>
</HTML>
(thankyou.asp)
<%@language=vbscript%>
<%option explicit%>
<html>
<head>
<meta http-equiv="refresh" content="5;
URL=http://www.swishercs.com/dfc/obits.asp" target="main">
<title>Condolances</title>
<!--#include file="adovbs.inc"-->
</head>
<body bgcolor="white">
<%
DIM objCN, objRS, objProp
SET objCN = Server.CreateObject("ADODB.Connection")
objCN.ConnectionString = "DSN=condolences.dsn"
objCN.Open
SET objRS = Server.CreateObject ("ADODB.Recordset")
objRS.OPEN "condolences", objCN, adOpenDynamic, adLockOptimistic
objRS.AddNew
objRS("firstname") = Request.Form("firstname")
objRS("lastname") = Request.Form("lastname")
objRS("Fname") = Request.Form("fname")
objRS("lname") = Request.Form("lname")
objRS("email") = Request.Form("email")
objRS("condolences") = Request.Form("condolences")
objRS.Update
%>
<br><br><br>
<center><font face=Times New Roman size="5"><i>Thank you,
<%=objRS("Fname")%> <%=objRS("Lname")%> We will see that the
family gets your condolences</i></font></center>
</body>
</html>