<% option explicit %> <% dim redirectUrl redirectUrl = "http://www.cajungrocer.com" Dim adOpenForwardOnly , adLockReadOnly , adCmdTable, sql, action adOpenForwardOnly = 0 adLockReadOnly =1 adCmdTable =2 'variable declaration in here Dim objConn , objRS if ((not isEmpty(request.queryString("action"))) and (not isEmpty(request.queryString("cid"))))then action = request.queryString("action") if (action = "displayCategory") then 'create our objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") 'connect to the MySQL example database objConn.Open "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=cajungrocer;pwd=cajungrocer;database=cajungrocer" sql = "select * from categories where old_category_id = '" & request.queryString("cid") & "'" objRS.Open sql , objConn , adOpenForwardOnly , adLockReadOnly if objRS.EOF or objRS.BOF then Response.Redirect(redirectUrl) else redirectUrl = redirectUrl & "/default.php?cPath=" & objRS.Fields("categories_id") Response.Redirect(redirectUrl) end if objRS.Close Set objRS = Nothing Set onjConn = Nothing else 'redirect to home page Response.Redirect(redirectUrl) end if else 'redirect to home page Response.Redirect(redirectUrl) end if %>