%
if Len(Session("id"))= 0 then
Response.redirect "default.asp"
end if
%>
<% @LANGUAGE="VBSCRIPT" %>
<%
sid = Request.QueryString("sid")
Set sayfa = Server.CreateObject("Adodb.RecordSet")
sql_sayfa = "Select * from EkIcerik where sId = " & sid
sayfa.open sql_sayfa,bag,1,3
if sayfa.eof or sayfa.BOF then
response.Write("Sayfa bulunamadi")
response.End()
else
strFileContents = sayfa("kod")
Sayfa_Adi = sayfa("SayfaAdi")
end if
'*** create fso object
'***---
'*** get the name of this page (script) dynamically - you could specify this if you want
dim strScriptName
strScriptName = request.servervariables("script_name")
strScriptName = mid(strScriptName, instrrev(strScriptName, "/") + 1)
'***---
'***--- if they've not submitted the update form
if request.form("kaydet") = "" then
const fsoForReading = 1
else if request.form("kaydet") <> "" then
if Request.Form("SayfaAdi")="" then
Response.Write "Sayfa Adı Girilmedi"
Response.End
end if
'***---
'*** get the contents
dim strWriteContents
strWriteContents = request.form("pageHTML")
'***---
'***---
'*** page text isn't a requirement as we can sort out an error message to some extent in replace.
if strWriteContents = "" then
strWriteContents = ""
strWriteContents = strNewContent & vbCrLf & "
"
strWriteContents = strNewContent & vbCrLf & ""
end if
'***---
Set connkaydet = Server.CreateObject("ADODB.RecordSet")
sql_kaydet = "Select * from EkIcerik where sId = " & Request.QueryString("sid")
connkaydet.open sql_kaydet,bag,1,3
connkaydet("SayfaAdi") = Request.Form("SayfaAdi")
connkaydet("Kod") = strWriteContents
connkaydet("Tarih") = now
connkaydet.update
connkaydet.close
set connkaydet = Nothing
'***---
'*** write it into the file
'***---
'*** lets go home
response.Redirect("ekicerik.asp")
'***---
end if
end if
%>