Form pge code..
<form ENCTYPE="MULTIPART/FORM-DATA" method="post" action="postadd.asp" name="addfrm" onsubmit="return validate(addfrm)">
<tr bgColor=#dedede><td><b>Category</b></td>
<td><SELECT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" name=AD_TYPE>
<% Do while not Res.EOF %>
<option value=<%=Res("Type_id")%> selected><%=Res("Type_name")%></option>
<%Res.MoveNext
Loop
%>
</SELECT></td></tr>
<TR bgColor=#dedede><td><B>AD Title</B></td><td><B>
<input maxLength=50 size=43 name=AD_TITLE style="FONT-SIZE: 8pt; WIDTH: 276px; FONT-FAMILY: verdana; HEIGHT: 23px"></B></td></TR>
<TR bgColor=#dedede><td><strong> Poster</strong> </td><td><b><%=Session("Userid")%></b></td></TR>
<TR bgColor=#dedede><td><B>Durations</B></td>
<td><SELECT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" name=AD_EXPIRED>
<option value="<%= date+30%>" selected>30 days</option>
<option value="<%= date+60%>">60 days</option>
<option value="<%= date+90%>">90 days</option></SELECT></td></TR>
<TR bgColor=#dedede><td><strong> Quantity</strong> </td>
<td><input
maxLength=5
size=5 name=AD_QUANTITY
style="FONT-SIZE: 8pt; FONT-FAMILY: verdana"> (Optional)</td></TR>
<TR bgColor=#dedede><td><B>Price</B></td>
<td><input
size=15
name=AD_PRICE style="FONT-SIZE: 8pt; FONT-FAMILY: verdana"><strong> </strong> (Optional)</td></TR>
<TR bgColor=#dedede><td><strong> Site URL</strong> </td>
<td><input size=43 value=http://www. name=AD_LINK style="FONT-SIZE: 8pt; WIDTH: 272px; FONT-FAMILY: verdana; HEIGHT: 19px"> (Optional)</td></TR>
<TR bgColor=#dedede><td><strong> Image</strong> </td><td>
<input type=file size=31 name=AD_IMAGE style="FONT-SIZE: 8pt; WIDTH: 269px; FONT-FAMILY: verdana; HEIGHT: 19px"> (Optional)</td></TR>
<TR bgColor=#dedede><td><strong> Description</strong> </td>
<td><TEXTAREA style="FONT-SIZE: 8pt; FLOAT: left; WIDTH: 325px; FONT-FAMILY: verdana; HEIGHT: 198px" name=AD_DESCRIPTION rows=12 cols=37></TEXTAREA></td></TR>
<TR bgColor=#dedede><TD align=right colSpan=2><INPUT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" type=submit value="Post My Ad" name=submit></TD></TR></form></table><!-- end middle column -->
---------------------------------------------------------------
Post add code..
<%
'Makes the browser not cache this page
Response.Expires = -1000 'Makes the browser not cache this page
Response.Buffer = True 'Buffers the content so our Response.Redirect will work
' Declaring variables
Dim categ, adtitle, poster, duration, quantity, price, siteurl, img, ad_desc, sql_insert,fcont,upload
' Uploading files into one directories
Set upl = Server.CreateObject("SoftArtisans.FileUp")
upl.path "D:\hshome\abc\abc.com\image"
Set upl.Maxbytes = 300
' Receiving values from Form
categ = upl.Form("ad_type")
adtitle = upl.Form("ad_title")
poster = Session("Userid")
duration = upl.Form("ad_expired")
quantity = upl.Form("ad_quantity")
price = upl.Form("ad_price")
siteurl = upl.Form("ad_link")
img = upl.Form("ad_image")
ad_desc = upl.Form("ad_description")
FCONT = upl.ContentType
if upl.Form(image").IsEmpty then
img = "blank.gif"
end if
'--- Use the Select Case Condition to restrict the file type.
Select Case LCase(FCONT)
Case "image/gif"
upl.Save
Case "image/jpeg"
upl.Save
Case "image/bmp"
upl.Save
Case Else
upl.delete
upload=1
End Select
'file_name = upl.Shortfilename
If not upload=1 then
sql_insert = "insert into ads(ad_type, ad_title, ad_dated, ad_expired, ad_poster, ad_quantity, ad_price, ad_link, ad_image, ad_description, ad_viewed, ad_approved) values ('" & _
categ & "', '" & adtitle & "', '" & poster & "', now(), & duration &, & quantity &, '" & price & "','" & siteurl & "', '" & img & "','" & ad_desc & "', 0 , 0)"
' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open "DSN=abc;UID=abc;PWD=abc;DATABASE=abc"
Set Rs = Server.CreateObject("ADODB.Recordset")
con.Execute(sql_insert)
else
Response.Redirect("newadd.asp?upload=fail")
end if
%>
With thanks !
sqlboy