form text automatically sent to table

liunx

Guest
I have a classifieds section which I want to automate. What I mean is that I want staff to input their items on a form on the site and then the details are sent to the classifieds page and input in a table. The thing is, do I have to use a database to store the info first? Can the info go straight from the form to the classads page?

Also there are 3 different sections; sale, services and notices. Could I use one asp processing page with an If, Then statement? I just dont know how to go about starting this.
Thanks for any help

SashHere's how I'd do it.

Create two tables - CLASSIFIEDS and SECTIONS

Here's how they'd look

CLASSIFIEDS
ID (int)
DESCRIPTION (larger varchar or blob)
SECTION_ID (int)

SECTIONS
ID (int)
SECTION (varchar)

On your input form, you have the user enter in a description and then you use the SECTIONS table to populate a <select> box and have them select that as well.

Now, on your Classifieds page I'd do this....

<%
set rs = db.execute("SELECT ID,SECTION FROM SECTIONS")
while not(rs.eof)%>
<b><%=rs("SECTION")%></b>
<%
set rs2 = db.execute("SELECT ID,DESCRIPTION FROM CLASSIFIEDS WHERE SECTION_ID = " & rs("ID"))
while not(rs2.eof)%>
<br><p><%=rs2("DESCRIPTION")%></p><br>
<% rs2.moveNext
wend
rs.moveNext
wend%>


Now, there's better ways to format that and more efficient ways to code it, but that's the general jist of things.Thanks Putts I will give it a try.

Sash
 
Back
Top