Set clas = Server.CreateObject("ADODB.Recordset")
clas.Open _
"SELECT * FROM Items WHERE Category='" & _
Request("Category") & "'",_
Connect,adOpenDynamic,adLockOptimistic
clas.AddNew
clas("Item") = Request("Item")
clas("Category") = Request("Category")
clas("Description") = Request("Description")
clas("Price") = Request("Price")
clas("Phone") = Request("Phone")
clas("Email") = Request("Email")
clas("State") = Request("State")
clas("Posted") = Date
clas("Password") = Request("Password")
clas.Update
If Err.Number = 0 Then %>
<font size=5><i>Your clasified ad has been placed.</i></font><p>
<a href="default.asp">Home</a><p>
<% Else %>
There was an error placing your ad.<p>
Error #<%=Err.Number%>: <%=Err.Description%><p>
<% End If %>
<% End If %>
<%
' The first time this page is retrieved and any time it is
' submitted without being completely filled out, the form
' is displayed. If it is submitted and completely filled out
' the form is processed in the Else clause.
If Request("Item")="" Or Request("Description")="" Or _
Request("Price")="" Or Request("Phone")="" Or _
Request("Email")="" Or Request("State")="" Then
%>
<% ShowHeader "Place A New Ad" %>
Please fill in all of these fields below. Be sure to choose
an appropriate Category for your item.<p>
Be careful when entering a Password and be sure to remember what
you type. You will be required to enter the password later to
identify you if you need to edit or delete this ad.<p>
When you are finished, click the Place Ad button.<p>
<% Else %>
<%
Dim Connect
Dim clas
Dim Query
Dim Category
ShowHeader "Place A New Ad"
On Error Resume Next
%>
<font size=5><b>CATEGORY: <%=Request("Category")%></b></font>
<%
ShowItem Request("Item"),Request("Description"),_
Request("Price"),Request("Phone"),Request("Email"),_
Request("State"),Date
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "classifieds"
Set clas = Server.CreateObject("ADODB.Recordset")
clas.Open _
"SELECT * FROM Items WHERE Category='" & _
Request("Category") & "'",_
Connect,adOpenDynamic,adLockOptimistic
clas.AddNew
clas("Item") = Request("Item")
clas("Category") = Request("Category")
clas("Description") = Request("Description")
clas("Price") = Request("Price")
clas("Phone") = Request("Phone")
clas("Email") = Request("Email")
clas("State") = Request("State")
clas("Posted") = Date
clas("Password") = Request("Password")
clas.Update
If Err.Number = 0 Then %>
<font size=5><i>Your clasified ad has been placed.</i></font><p>
<a href="default.asp">Home</a><p>
<% Else %>
There was an error placing your ad.<p>
Error #<%=Err.Number%>: <%=Err.Description%><p>
<% End If %>
<% End If %>