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.AS P (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.as p 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.as p 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.as p 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="f ixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">O bituaries</font>
<center>Click <a href="condolenc es.asp">here</a> to view the guestbook
for all condolences.</center>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateOb ject ("ADODB.Records et")
rs.Open "deceased", "DSN=condolence s.dsn"
While Not rs.EOF
Response.Write "Name: " & rs("firstname" ) & " " &
rs("lastname") & " " & "<a href=DBInputFor mc.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.a sp)
<html>
<head>
<title>Condolen ces</title>
</head>
<body bgcolor="white" >
<center><b><fon t 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="thankyo u.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: &n bsp  <i nput type="text" name="staddress "
size="45"><br>
City:                <input
type="text" name="city" size="20"><br>
State: &nbs p  &nbs p  &nbs p  <inp ut
type="text"
name="state" size="15"><br>
Zip:  & nbsp  & nbsp  & nbsp  & nbsp  < input
type="text"
name="zip" size="20"><br>
Email:         <input type="text" name="email"
size="25"><br>
Condolences:<TE XTAREA NAME="condolenc es" ROWS=6
COLS=60></TEXTAREA><br>
<center><inpu t type="submit" value="Submit!" ><br><br></b></center>
</font>
</form>
</body>
</html>
(condolences.as p)
<% Response.Buffer = True %>
<html>
<head>
<title>Davis Funeral Chapel Condolences</title>
</head>
<body>
<BODY BGCOLOR="white" bgproperties="f ixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">C ondolences</font>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateOb ject ("ADODB.Records et")
rs.Open "condolence s", "DSN=condolence s.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 "Condolence s: " & rs("condolences ") & "<hr>" & "<br>"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
%>
</BODY>
</HTML>
(thankyou.asp)
<%@language=vbs cript%>
<%option explicit%>
<html>
<head>
<meta http-equiv="refresh" content="5;
URL=http://www.swishercs.c om/dfc/obits.asp" target="main">
<title>Condolan ces</title>
<!--#include file="adovbs.in c"-->
</head>
<body bgcolor="white" >
<%
DIM objCN, objRS, objProp
SET objCN = Server.CreateOb ject("ADODB.Con nection")
objCN.Connectio nString = "DSN=condolence s.dsn"
objCN.Open
SET objRS = Server.CreateOb ject ("ADODB.Records et")
objRS.OPEN "condolence s", objCN, adOpenDynamic, adLockOptimisti c
objRS.AddNew
objRS("firstnam e") = Request.Form("f irstname")
objRS("lastname ") = Request.Form("l astname")
objRS("Fname") = Request.Form("f name")
objRS("lname") = Request.Form("l name")
objRS("email") = Request.Form("e mail")
objRS("condolen ces") = Request.Form("c ondolences")
objRS.Update
%>
<br><br><br>
<center><font face=Times New Roman size="5"><i>Tha nk you,
<%=objRS("Fname ")%> <%=ob jRS("Lname")%> We will see that the
family gets your condolences</i></font></center>
</body>
</html>