<% ID = request("ID") Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From Ads where Add_Id =" & ID 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 strTitle = objRS("Ad_Title") strPrice = objRS("Price") strDescription = objRS("Ad_Description") strImageUrl = objRS("Ad_Photo") strCategory = objRS("cl_cat_ID") strTitle2 = request("title") strPrice2 = request("Price") strDescription2 = request("Description") strImageUrl2 = request("ImageUrl") strCategory2 = request("Category") if Request.Form <> "" then 'Sets an error message if any required fields are left blank if strTitle2 = "" or strDescription2 = "" or strCategory2="" then Msg = "
All fields marked with an * are required." end if If Msg = "" then objRs.Fields("Ad_Title") = strTitle2 objRs.Fields("Price") = strPrice2 objRs.Fields("Ad_Description") = strDescription2 objRs.Fields("Ad_Photo") = strImageUrl2 objRs.Fields("cl_cat_ID") = strCategory2 objRs.update Response.Redirect "cl_saved.asp" end if end if %>
<% if msg <> "" then %> Message: <%= msg %> <% end if %>
Edit Classified
Ad Title*
Category* <% Set rsCat = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From Categories" 'Set the recordset object equal to the SQL query string rsCat.Open SQL, objADO, 1, 3 %>
Price $ <% if request.form <> "" then %> <% else %> <% end if %>
Description*
Be sure to include "http://" before your image URLS's!!!
Image URL (OPTIONAL)