Back to admin CP
ADD/DELETE/UPDATE CONTENT


<% if request("cmd")="edit" then set r0=Server.CreateObject("ADODB.Recordset") q0="select * from tbl_content where id=" & request("id") set r0=con.execute(q0) txt=r0("content") title=r0("title") end if if request("cmd")="del" then con.execute "delete * from tbl_content where id=" & request("id") end if if request("cmd")="add" then if request("title")="" then response.Write("Please enter title") elseif request("msg")="" then response.Write("Please enter content") else set r1=Server.CreateObject("ADODB.Recordset") q1="select * from tbl_content where pg='" & request("pg") & "'" set r1=con.execute(q1) if r1.eof then set r2=Server.CreateObject("ADODB.Recordset") r2.open "select * from tbl_content",con,3,3,1 r2.addnew r2("title")=Replace(request("title"), "'", "''") r2("content")=Replace(request("msg"), "'", "''") r2("pg")=request("pg") r2.update response.Write("Content has been added successfully") response.Redirect("addcontent.asp") else con.execute "update tbl_content set title='" & Replace(request("title"), "'", "''") & "', content='" & Replace(request("msg"), "'", "''") & "' where pg='" & request("pg") & "'" response.Redirect("addcontent.asp") response.Write("Content has been updated successfully") end if end if end if %>
Select Page Category :
Title


<% pga=TRIM(Request("pga")) if pga="" then pga=1 Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.ActiveConnection = Con rs2.CursorType=1 rs2.PageSize=10 qr2="select * from tbl_content" rs2.open qr2 if rs2.eof then Response.write "No content exists" else rs2.AbsolutePage=pga while not rs2.eof and rowcount < rs2.PageSize rowcount=rowcount+1 %> <% rs2.movenext wend end if %>
IDContentDelete
<%=rs2("ID")%> <%=Left(rs2("content"),50)%> ">
<% If rs2.PageCount > 1 Then %> Go to page : <% For I = 1 To rs2.PageCount If I <>cINT(pga) Then %> &pga=<%=i%>"> <%=I %>  <% Else %> <%=i%>  <%End If%> <%next%> <% end if %>