<%@ Language=VBScript %>
<%
dbms = Request.QueryString("dbms")
movecnt = Request.QueryString("movecnt")
dim path, pos
dim fs, f, fc
path = Server.mappath("register.asp")
path = Replace(path, "\", "/")
pos = InStr(1,path,"animals")
path = Left(path, pos - 1) & "gif/"
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(path)
Set fc = f.Files
idval = ""
nameval = ""
areaval = ""
hval = ""
wval = ""
gifval = "boa.gif"
set RS = Session("animalsRd")
if Request.Form("GifField").Count > 0 then
idval = Request.Form("IdField")
nameval = Request.Form("NameField")
areaval = Request.Form("AreaField")
hval = Request.Form("HeightField")
wval = Request.Form("WeightField")
gifval = Request.Form("GifField")
gifFile
= path & gifval
if Cint( Request.QueryString("chggif")
) = 0 then
RS.AddNew
RS("Id")
= idval
RS("Name")
= nameval
RS("Area")
= areaval
RS("Height")
= hval
RS("Weight")
= wval
RS("Gif")
= "$file:" & gifFile
RS.Update
RS.MoveLast
movecnt = RS.RecordCount
Response.redirect
"main.asp?dbms=" & dbms & "&movecnt="
& movecnt
end if
else
gifFile = fc.item("boa.gif")
end if
%>
<HTML>
<HEAD>
</HEAD>
<BODY onLoad="document.form1.GifField.focus();">
<form name=form1 method=post action="main.asp?dbms=<%=dbms%>&movecnt=<%=movecnt%>">
<TABLE width=100%><TR>
<TD align=center width=360>
<table width=100%>
<tr><td align=center width=40%><b>Id:</b></td>
<td width=60%><INPUT name=IdField size=25 value="<%=idval%>"></td></tr>
<tr><td align=center width=40%><b>Name:</b></td>
<td><INPUT name=NameField size=25 value="<%=nameval%>"></td></tr>
<tr><td align=center width=40%><b>Area:</b></td>
<td><INPUT name=AreaField size=25 value="<%=areaval%>"></td></tr>
<tr><td align=center width=40%><b>Height:</b></td>
<td><INPUT name=HeightField size=25 value="<%=hval%>"></td></tr>
<tr><td align=center width=40%><b>Weight:</b></td>
<td><INPUT name=WeightField size=25 value="<%=wval%>"></td></tr>
<tr><td align=center width=40%><b>Gif:</b></td>
<td><select name=GifField width=180 style="WIDTH:180"
onchange=ChgPicture()>
<%
for each ff in fc
if gifval = ff.name then
%>
<option selected><%=ff.name%>
<%
else
%>
<option><%=ff.name%>
<%
end if
next
%>
</select></td></tr>
<tr><td align=center width=40%><BR>
<INPUT name=register type=button value=" OK " onClick="return
regOnClick();"></td>
<td><BR><INPUT type=submit name=back value="Cancel"></td></tr>
</table>
</TD><TD valign=top><img src="<%=gifFile%>"
border=0></TD>
</TR></TABLE>
</form>
<hr size="1" color="#000000">
<EM>This is <%=dbms%> database.</EM>
<font size="+1">
<center><a href="selectdb.asp" target=main>
Return Home</a></center></font>
</BODY>
</HTML>
|