fzd
asked on
How can I change the asp page encoding to greek?
I have a cms and I am not very familiar with .asp.
The content managmenet system is based on a default.asp page where it takes several values (id=1--> x) and accordingly shows different pages of the website.
When I change the encoding of the IE or Firefox browser to windows - greek - 1253 the fonts are perfect.
Howe can I automate this change so that each time any page is loaded it changes the ecnoding automatically to greek>? Thanks in advance
Below I provide you with the defualt.asp code.
<%@LANGUAGE="VBSCRIPT"%>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset =windows-1 252">
<%
'On Error Resume Next
Response.CacheControl = "Public"
'Option Explicit
%>
<!--#include file="Connections/connCMS. asp" -->
<%
If Application("DestroyCache" ) = ""Â Then
      Call DestroyCache
      Application.Lock
      Application("DestroyCache" ) = "1"
      Application.UnLock()
End If
Dim GFDB, strSN, strSiteName, appPageNum, intStart, MyWebPage, IsPageDynamic, MyVisitors, MyDate, Page_Content
Dim MyScript, MyResultsPageScript, rownum
appPageNum = Request("Page")
If appPageNum = ""Â Then appPageNum = "0"
strSiteName = Replace(strSP2,"/","")
If strSiteName = ""Â Then strSiteName = "CMS"
If Application(strSiteName &Â "_Page" &Â appPageNum) = ""Â Then GFDB = True
If Application(strSiteName &Â "_Content" &Â appPageNum) = ""Â Then GFDB = True
%>
<%
intStart = timer
If Request("ap") <>Â "" Then
      If Session("xpage") <> "" Then
           appPageNum = Session("xpage")
           GFDB = False
      End If
End If
Session("xpage") = ""
MyWebPage = ""
IsPageDynamic = 0
MyVisitors = Application("ActiveUsers")
MyDate = FormatDateTime(Date(), vbLongDate)
Page_Content = ""
MyScript = "<"Â + chr(37) + "Server.Execute({ASP_page_ to_execute }) "Â + chr(37) + ">"
MyResultsPageScript = "<% Server.Execute(""ASP\"" &Â Request.QueryString(""ap"" )) "&chr(37)&">"
'************************* ********** ******
' Start of Get From Database
'************************* ********** ******
If GFDB Then
Function GetFldData(fldnum,varCheck )
      Dim RecFound, ipage
      RecFound = False
      For ipage = 0 to numrows
           If MyPages(fldnum,ipage) = varCheck Then
                 RecFound = True
                 Exit For
           End If
      Next
      If NOT Recfound Then ipage = -1
      GetFldData = ipage
End Function
Function GetFldData2(fldnum2,varChe ck2)
      Dim RecFound2, jpage
      RecFound2 = False
      For jpage = 0 to numrows2
           If MyTemplates(fldnum2,jpage) = varCheck2 Then
                 RecFound2 = True
                 Exit For
           End If
      Next
      If NOT Recfound2 Then jpage = -1
      GetFldData2 = jpage
End Function
Dim com, rsTemplate, MyPages, rsTmplts, numrows, numrows2
Set con = Server.CreateObject("ADODB .Connectio n")
con.Open MM_connCMS_STRING
Set rsTemplate = con.Execute("SELECT * FROM qryTemplate_Content")
MyPages = rsTemplate.GetRows()
rsTemplate.close()
Set rsTemplate = Nothing
Set rsTmplts = con.Execute("SELECT * FROM CMS_Templates")
MyTemplates = rsTmplts.GetRows()
rsTmplts.close()
Set rsTmplts = Nothing
con.Close
Set con = Nothing
numrows=ubound(MyPages,2)
numrows2=ubound(MyTemplate s,2)
If appPageNum = "0" Then
      rownum = GetFldData(7,1)
Else
      rownum = GetFldData(0,CInt(appPageN um))
End If
If rownum >Â -1 Then
      Dim MyWebPageID, MyDocTitle, MyASPpage, MyPageTitle, MyPageHeadContent, MyBgcolor
      Dim Page_Template, ParentPage, MyRegistration, strDCmenuH, strDCmenuH1, strDCmenuH2
      Dim strDCmenuV, strDCmenuV1, strDCmenuV2, MyMainMenu, MyDivider, MySubMenu, MyBullet
      Dim MyVar1, MyVar2, MyVar3, MyToken1, MyMenu1, MyMenuID1, MyBC, MyBCdivider, WasHomePage
      Dim MySearch
      MyWebPageID = MyPages(0,rownum)
      MyDocTitle = MyPages(5,rownum)
      MyASPpage = MyPages(14,rownum)
      Application.Lock
      Application(strSiteName & "_ASPPage" & CStr(MyWebPageID)) = MyASPpage
      Application.UnLock
      MyPageTitle = MyPages(2,rownum)
      MyPageHeadContent = MyPages(12,rownum)
      If MyPages(18,rownum) = 1 Then
           MyPrSc = "<!-- {IsPrivate} -->" & vbCrlf & ""
           MyPageHeadContent = MyPrSc & MyPageHeadContent
      End If
      MyBgcolor = MyPages(4,rownum)           Â
      Page_Template = MyPages(3,rownum)
      Page_Content = MyPages(6,rownum)
      MyWebPage = Replace(Page_Template,"{Co ntent}","{ PageConten t}")
      ParentPage = MyPages(8,rownum)
      MyRegistration = MyPages(16,rownum)
      If ParentPage > 0 and Not IsNull(ParentPage) Then
           rownum2 = GetFldData2(0,ParentPage)
           While rownum2 > -1
                 MyWebPage = Replace(MyTemplates(2,rown um2),"{Con tent}",MyW ebPage)
                 ParentPage = MyTemplates(6,rownum2)
                 MyBgcolor = MyTemplates(3,rownum2)
                 rownum2 = GetFldData2(0,ParentPage)
           Wend
      End If
      If (InStr(1,MyWebPage,"{hMenu }") > 0) Then
           strDCmenuH = "<script type=""text/javascript"">" & vbCrLf
           strDCmenuH = strDCmenuH & "var m1 = new COOLjsMenuPRO(""menu1"", MENU_ITEMS)" & vbCrLf
           strDCmenuH = strDCmenuH & "m1.initTop();" & vbCrLf
           strDCmenuH = strDCmenuH & "</script>" & vbCrLf
           strDCmenuH = strDCmenuH & "<script type=""text/javascript"">" & vbCrLf
           strDCmenuH = strDCmenuH & "m1.init();" & vbCrLf
           strDCmenuH = strDCmenuH & "m1.show();" & vbCrLf
           strDCmenuH = strDCmenuH & "</script>" & vbCrLf
           strDCmenuH1 = strDCmenuH1 & "<LINK href=""CMSmenu/style.css"" type=text/css rel=stylesheet>" & vbCrLf
           strDCmenuH1 = strDCmenuH1 & "<SCRIPT src=""CMSmenu/menu.js"" type=text/javascript></SCR IPT>" & vbCrLf
           strDCmenuH1 = strDCmenuH1 & "<SCRIPT src=""ASP/menuitems.JS"" type=text/javascript></SCR IPT>" & vbCrLf & "</head>"
           MyWebPage = Replace(MyWebPage,"{hMenu} ",strDCmen uH)
           MyPageHeadContent = Replace(MyPageHeadContent, "</head>", strDCmenuH 1)
      End If
      If (InStr(1,MyWebPage,"{vcMen u}") > 0) Then
           strDCmenuV = "<SCRIPT type=text/javascript>" & vbCrLf
           strDCmenuV = strDCmenuV & "var tree = new COOLjsTreePRO(""tree1"", TREE1_NODES, TREE1_FORMAT);" & vbCrLf
           strDCmenuV = strDCmenuV & "tree.init();" & vbCrLf
           strDCmenuV = strDCmenuV & "</SCRIPT>"
           strDCmenuV1 = strDCmenuV1 & "<link href=""CMSmenu/menuv.css"" type=text/css rel=stylesheet>" & vbCrLf
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv.js"">< /script>" & vbCrLf
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv_format .js""></sc ript>" & vbCrLf
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""ASP/menuv_nodes.js"" ></script> " & vbCrLf & "</head>"
           strDCmenuV2 = strDCmenuV2 & "<script language=""JavaScript"">Re drawAllTre es()</scri pt>" & vbCrLf & "</body>"
           MyWebPage = Replace(MyWebPage,"{vcMenu }",strDCme nuV)
           MyPageHeadContent = Replace(MyPageHeadContent, "</head>", strDCmenuV 1)
           MyPageHeadContent = Replace(MyPageHeadContent, "</body>", strDCmenuV 2)
      End If
      If (InStr(1,MyWebPage,"{MainM enu}") > 0) or (InStr(1,Page_Content,"{Ma inMenu}") > 0)  Then
           MyMainMenu = ""
           MyDivider = " | "
           For i = 0 to numrows
                 If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                      If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                      MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{MainMe nu}",MyMai nMenu)
           Page_Content = Replace(Page_Content,"{Mai nMenu}",My MainMenu)
      End If
      If (InStr(1,MyWebPage,"{MainM enuV}") > 0) or (InStr(1,Page_Content,"{Ma inMenuV}") > 0) Then
           MySubMenu = ""
           MyBullet = "•" & " "
           For i = 0 to numrows
                 If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                      MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{MainMe nuV}",MySu bMenu)
           Page_Content = Replace(Page_Content,"{Mai nMenuV}",M ySubMenu)
      End If
      If (InStr(1,MyWebPage,"{Subme nu}") > 0) or (InStr(1,Page_Content,"{Su bmenu}") > 0) Then
           MyMainMenu = ""
           MyDivider = "•" & " "
           For i = 0 to numrows
                 If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                      MyMainMenu = MyMainMenu & MyDivider & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A><br>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{Submen u}",MyMain Menu)
           Page_Content = Replace(Page_Content,"{Sub menu}",MyM ainMenu)
      End If
      If (InStr(1,MyWebPage,"{hSubm enu}") > 0) or (InStr(1,Page_Content,"{hS ubmenu}") > 0) Then
           MyMainMenu = ""
           MyDivider = " | "
           For i = 0 to numrows
                 If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                      If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                      MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{hSubme nu}",MyMai nMenu)
           Page_Content = Replace(Page_Content,"{hSu bmenu}",My MainMenu)
      End If
      If (InStr(1,Page_Content,"{{S ubmenu=") > 0) Then
           MyVar1 = InStr(1,Page_Content,"{{Su bmenu")
           MyVar2 = MyVar1 + 10
           MyVar3 = InStr(1,Page_Content,"}}")
           MyToken1 = Mid(Page_Content,MyVar1,(M yVar3 + 2 - MyVar1))
           MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MySubMenu = ""
                 MyBullet = "•" & " "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                      End If
                 Next
                 Page_Content = Replace(Page_Content,MyTok en1,MySubM enu)
           End If
      End If
      If (InStr(1,MyWebPage,"{{Subm enu=") > 0) Then
           MyVar1 = InStr(1,MyWebPage,"{{Subme nu")
           MyVar2 = MyVar1 + 10
           MyVar3 = InStr(1,MyWebPage,"}}")
           MyToken1 = Mid(MyWebPage,MyVar1,(MyVa r3 + 2 - MyVar1))
           MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MySubMenu = ""
                 MyBullet = "•" & " "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                      End If
                 Next
                 MyWebPage = Replace(MyWebPage,MyToken1 ,MySubMenu )
           End If
      End If
      If (InStr(1,Page_Content,"{{h Submenu=") > 0) Then
           MyVar1 = InStr(1,Page_Content,"{{h" )
           MyVar2 = MyVar1 + 11
           MyVar3 = InStr(1,Page_Content,"}}")
           MyToken1 = Mid(Page_Content,MyVar1,(M yVar3 + 2 - MyVar1))
           MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MyMainMenu = ""
                 MyDivider = " | "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                            MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                      End If
                 Next
                 Page_Content = Replace(Page_Content,MyTok en1,MyMain Menu)
           End If
      End If
      If (InStr(1,MyWebPage,"{{hSub menu=") > 0) Then
           MyVar1 = InStr(1,MyWebPage,"{{h")
           MyVar2 = MyVar1 + 11
           MyVar3 = InStr(1,MyWebPage,"}}")
           MyToken1 = Mid(MyWebPage,MyVar1,(MyVa r3 + 2 - MyVar1))
           MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MyMainMenu = ""
                 MyDivider = " | "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                            MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                      End If
                 Next
                 MyWebPage = Replace(MyWebPage,MyToken1 ,MyMainMen u)
           End If
      End If
      If (InStr(1,MyWebPage,"{Bread crumbs}") > 0) or (InStr(1,Page_Content,"{Br eadcrumbs} ") > 0) Then
           ParentPage = MyWebPageID
           MyBC = ""
           MyBCdivider = " > "
           WasHomePage = 1
           rownum = GetFldData(0,ParentPage)
           While ParentPage <> 0
                 If MyBC <> "" Then MyBC = MyBCdivider & MyBC
                 MyBC = "<a href='Default.asp?Page=" & MyPages(0,rownum) & "'>" & MyPages(2,rownum) & "</a>" & MyBC
                 ParentPage = MyPages(9,rownum)
                 If ParentPage = 0 and MyPages(7,rownum) = 0 Then
                      WasHomePage = 0
                 End If
                 rownum = GetFldData(0,ParentPage)           Â
           Wend
           If WasHomePage = 0 Then
                 MyBC = "<a href='Default.asp'>Home</a >" & MyBCdivider & MyBC
           End If           Â
           MyWebPage = Replace(MyWebPage,"{Breadc rumbs}",My BC)
           Page_Content = Replace(Page_Content,"{Bre adcrumbs}" ,MyBC)
      End If
      If (InStr(1,MyWebPage,"{Searc h}") > 0) or (InStr(1,Page_Content,"{Se arch}") > 0) Then
           MySearch = ""
           MySearch = MySearch + "<form name=" + Chr(34) + "SearchForm" + Chr(34) + " method=" + Chr(34) + "post" + Chr(34) + " action=" + Chr(34) + "default.asp" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "Site Search<br>" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "CMSsearch" + Chr(34) + " type=" + Chr(34) + "text" + Chr(34) + " size=" + Chr(34) + "12" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "CMS_search" + Chr(34) + " type=" + Chr(34) + "submit" + Chr(34) + " id=" + Chr(34) + "CMS_search" + Chr(34) + " value=" + Chr(34) + "Go" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "Page" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + CStr(MyWebPageID) + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "Search" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + "true" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "</form>"
           MyWebPage = Replace(MyWebPage,"{Search }",MySearc h)
           Page_Content = Replace(Page_Content,"{Sea rch}",MySe arch)
      End If
      MyWebPage = Replace(MyPageHeadContent, "{content} ",MyWebPag e)
      MyWebPage = Replace(MyWebPage,"{bgcolo r}",MyBgco lor)
      MyWebPage = Replace(MyWebPage,"{DocTit le}",MyDoc Title)
      MyWebPage = Replace(MyWebPage,"{PageTi tle}",MyPa geTitle)
      MyWebPage = Replace(MyWebPage,"{Regist er}",MyReg istration)
      Page_Content = Replace(Page_Content,"{Pag eTitle}",M yPageTitle )
      Page_Content = Replace(Page_Content,"{Reg ister}",My Registrati on)
      Application.Lock
      Application(strSiteName & "_Page" & CStr(MyWebPageID)) = MyWebPage
      Application(strSiteName & "_Content" & CStr(MyWebPageID)) = Page_Content
      Application.UnLock
Else
      MyWebPage = "That Web Page is not Found."
End If
Set MyPages = Nothing
Set MyTemplates = Nothing
Else
      MyWebPage = Application(strSiteName & "_Page" & appPageNum)
      Page_Content = Application(strSiteName & "_Content" & appPageNum)
      MyASPpage = Application(strSiteName & "_ASPPage" & appPageNum)
End If
'************************* ********** ******
' End of Get From Database
'************************* ********** ******
IsPageResults = False
ExecuteExternalASPpage = False
If Request("ap") <>Â "" Then MyASPpage = Request("ap")
If MyASPpage <>Â "" Then IsPageResults = True
RunScript = "RunScript.asp"
If MyASPpage <>Â "" Then
      ExecuteExternalASPpage = True
End If
If Request.QueryString <>Â "" Then RunScript = RunScript + "?" + Request.QueryString
If Request.QueryString("msg") <>Â "" Then
      Page_Content = Request.QueryString("msg")
      IsPageResults = True
End If
Function MakeQS(fvar,fvarname,fpage )
      NewQS = fvar
      AddParam = True
      If (InStr(1,fvar,"?") > 0) Then
           MyParams1 = Mid(fvar,InStr(1,fvar,"?") +1,Len(fva r))
           MyParams = Split(MyParams1,"&")
           AddParam = True
           For Each i in MyParams
                 If Ucase(Left(i,InStr(1,i,"=" )-1)) = Ucase(Trim(fvarname)) Then AddParam = False
           Next
      End If
      If AddParam Then
           If (InStr(1,fvar,"?") > 0) Then
                 NewQS = fvar + "&" + fvarname + "=" + fpage
           Else
                 NewQS = fvar + "?" + fvarname + "=" + fpage
           End If
      End If
      MakeQS = NewQS
End Function
Function InsertASPpage(fntoken,fnpa ge)
      InsertASPpage = Replace(MyWebPage,fntoken, Replace(My Script,"{A SP_page_to _execute}" ,chr(34) + "ASP/" + fnpage + chr(34)))
End Function
Function DisplayTokenByType(strT1, strT2, strASPpg, strType)
      DisplayTokenByType = False
      If InStr(1,MyWebPage,strT1) > 0 Then
           intVar = Len(strT1)
           IsPageDynamic = 1
           intVar1 = InStr(1,MyWebPage,strT1)
           intVar3 = InStr(1,MyWebPage,strT2)
           strToken = Mid(MyWebPage,intVar1,intV ar3-intVar 1+intVar)
           strTokenType = Mid(strToken,InStr(1,strTo ken,"=") + 1)
           strTokenType = Mid(strTokenType,1,InStr(1 ,strTokenT ype,"=") - 1)
           MyWebPage = InsertASPpage(strToken,str ASPpg)
           If (InStr(1,RunScript,strType ) = 0) Then
                 RunScript = MakeQS(RunScript,strType,s trTokenTyp e)
           End If
           DisplayTokenByType = True
      End If
End Function
If Request("ap") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("AR") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("NWS") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("PR") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("ce") <>Â "" Then Page_Content = "{Dynamic}"
If Request.Form("Search") <>Â "" Then Page_Content = "{#%SearchResults}"
If Request.QueryString("FAQ") <>Â "" Then Page_Content = "{Dynamic}"
IsHelpDesk = False
If (InStr(1,Page_Content,"{He lpDesk}") >Â 0) Then
      IsHelpDesk = True
      Page_Content = "{Dynamic}"
End If
AllowAccess = True
If ((InStr(1,MyWebPage,"{IsPr ivate") >Â 0) or IsHelpDesk) and Request.QueryString("np") <>Â "1" Then
      Session("xpage") = appPageNum
      If Session("LoggedIn") <> "Yes" Then
           AllowAccess = False
           Page_Content = "{Dynamic}"
      End If
End If
MyWebPage = Replace(MyWebPage,"{PageCo ntent}",Pa ge_Content )
If Request.Form("Search") <>Â "" Then
      Set con = Server.CreateObject("ADODB .Connectio n")
       con.Open MM_connCMS_STRING
  Set rsSearch = con.Execute("SELECT CMS_ID,CMS_Name FROM WebContent WHERE CMS_Active = 1 AND CMS_Content LIKE '%" & Request.Form("CMSsearch") & "%'")
      MySCounter = 1
      MySR = "<strong>Search Results</strong><br><br>"
      If Not rsSearch.eof Then
           While Not rsSearch.eof
                 MySR = MySR + CStr(MySCounter) + ". - <a href=" + Chr(34) + "Default.asp?Page=" + CStr(rsSearch("CMS_ID")) + Chr(34) + ">" + rsSearch("CMS_Name") + "</a><br>"
                 rsSearch.MoveNext()
                 MySCounter = MySCounter + 1
           Wend
      Else
           MySR = MySR + "No Pages Match Your Search..."
      End If
      Set rsSearch = Nothing
      con.Close
  Set con = Nothing
      MyWebPage = Replace(MyWebPage,"{#%Sear chResults} ",MySR)
      GFDB = True
End If
If InStr(1,MyWebPage,"{Dynami c}") >Â 0 Or Request("ap") <>Â "" Then
      IsPageDynamic = 1
      Session("xpage") = appPageNum
      IsPageResults = True
End If
MyWebPage = Replace(MyWebPage,"{Dynami c}",MyResu ltsPageScr ipt)
PageName = "ASP\Pg" &Â appPageNum &Â ".asp"
If IsPageResults Then PageName = "ASP\~Pg" &Â appPageNum &Â ".asp"
If ExecuteExternalASPpage Then
      PageName = "ASP\~PgDefault.asp"
      If Request("ap") = "" Then
           RunScript = MakeQS(RunScript,"ap",MyAS Ppage)
      End If
End If
If IsHelpDesk Then
      If AllowAccess Then
           RunScript = MakeQS(RunScript,"ap","HD_ List.asp")
      Else
           RunScript = MakeQS(RunScript,"ap","Mem ber_Login. asp")
      End If
End If
If Not AllowAccess Then RunScript = MakeQS(RunScript,"ap","Mem ber_Login. asp")
'************************* ********** ******
' Start of Prepare file for Write
'************************* ********** ******
      If Request.QueryString("AR") <> "" Then
           RunScript = MakeQS(RunScript,"ap","New sArticleDe tail.asp")
      End If
      If Request.QueryString("NWS") <> "" Then
           RunScript = MakeQS(RunScript,"ap","New sDetail.as p")
      End If
      If Request.QueryString("PR") <> "" Then
           RunScript = MakeQS(RunScript,"ap","Dis playPollRe sults.asp" )
      End If
      If Request.QueryString("ce") <> "" Then
           RunScript = MakeQS(RunScript,"ap","Dis playEvents .asp")
      End If
      If Request.QueryString("FAQ") <> "" Then
           RunScript = MakeQS(RunScript,"ap","FAQ Detail.asp ")
      End If
      If InStr(1,MyWebPage,"{NewsAr ticles2}") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsArticl es2}","Dis playNewsAr ticles2.as p")
      End If
      If InStr(1,MyWebPage,"{NewsAr ticles}") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsArticl es}","Disp layNewsArt icles.asp" )
      End If
      If InStr(1,MyWebPage,"{NewsCa t}") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsCat}", "DisplayNe wsCat.asp" )
      End If
      MyPhantomVar = DisplayTokenByType("{News2 =","=News2 }","Displa yNews2.asp ","Article _type")
      MyPhantomVar = DisplayTokenByType("{News= ","=News}" ,"DisplayN ews.asp"," Article_ty pe")
      If InStr(1,MyWebPage,"{FAQcat }") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{FAQcat}"," DisplayFAQ cat.asp")
      End If
      MyPhantomVar = DisplayTokenByType("{FAQ=" ,"=FAQ}"," DisplayFAQ s.asp","FA Q_type")
      MyPhantomVar = DisplayTokenByType("{Calen dar=","=Ca lendar}"," DisplayCal endar.asp" ,"Event_ty pe")
      MyPhantomVar = DisplayTokenByType("{Calen dar2=","=C alendar2}" ,"DisplayC alendar2.a sp","Event _type")
      If InStr(1,MyWebPage,"{%Poll= ") > 0 Then
           IsPageDynamic = 1
           PollVar1 = InStr(1,MyWebPage,"{%")
           PollVar2 = PollVar1 + 7
           PollVar3 = InStr(1,MyWebPage,"%}")
           MyPollToken = Mid(MyWebPage,PollVar1,(Po llVar3 + 2 - PollVar1))
           MyPoll = Mid(MyPollToken,8,(PollVar 3 - PollVar2))
           MyWebPage = InsertASPpage(MyPollToken, "DisplayPo ll.asp")
           RunScript = MakeQS(RunScript,"Poll_ID" ,MyPoll)
      End If
      If InStr(1,MyWebPage,"{Calend ar2}") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{Calendar2} ","Display Calendar2. asp")
      End If
      If InStr(1,MyWebPage,"{Calend ar}") > 0 Then
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{Calendar}" ,"DisplayC alendar.as p")
      End If
'************************* ********** ******
' End of Prepare file for Write
'************************* ********** ******
intEnd = timer
MyTimer = FormatNumber(intEnd - intStart,4)
MyWebPage = Replace(MyWebPage,"{Timer} ",MyTimer)
If IsPageDynamic = 1 Then
      MyWebPage = Replace(MyWebPage,"{Date}" ,"<" + chr(37) + "=FormatDateTime(Date(), vbLongDate)" + chr(37) + ">")
      MyWebPage = Replace(MyWebPage,"{Active Users}","< " + chr(37) + "=Application(" + chr(34) + "ActiveUsers" + chr(34) + ")" + chr(37) + ">")
      Set objFSO = Server.CreateObject("Scrip ting.FileS ystemObjec t")
      If GFDB Or Not objFSO.FileExists(Server.M apPath(Pag eName)) Then
           Set objText = objFSO.OpenTextFile(Server .MapPath(P ageName),2 ,True)
           objText.Write MyWebPage
           objText.Close
           Set objText = Nothing
      End If
      Set objFSO = Nothing
      RunScript = MakeQS(RunScript,"p",PageN ame)
      'RunScript = MakeQS(RunScript,"page",My WebPageID)
      'Response.Write(Runscript)
      'Response.End()
      Response.Redirect(RunScrip t)
End If
MyWebPage = Replace(MyWebPage,"{Date}" ,MyDate)
MyWebPage = Replace(MyWebPage,"{Active Users}",My Visitors)
Response.Write(MyWebPage)
%>
The content managmenet system is based on a default.asp page where it takes several values (id=1--> x) and accordingly shows different pages of the website.
When I change the encoding of the IE or Firefox browser to windows - greek - 1253 the fonts are perfect.
Howe can I automate this change so that each time any page is loaded it changes the ecnoding automatically to greek>? Thanks in advance
Below I provide you with the defualt.asp code.
<%@LANGUAGE="VBSCRIPT"%>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset
<%
'On Error Resume Next
Response.CacheControl = "Public"
'Option Explicit
%>
<!--#include file="Connections/connCMS.
<%
If Application("DestroyCache"
      Call DestroyCache
      Application.Lock
      Application("DestroyCache"
      Application.UnLock()
End If
Dim GFDB, strSN, strSiteName, appPageNum, intStart, MyWebPage, IsPageDynamic, MyVisitors, MyDate, Page_Content
Dim MyScript, MyResultsPageScript, rownum
appPageNum = Request("Page")
If appPageNum = ""Â Then appPageNum = "0"
strSiteName = Replace(strSP2,"/","")
If strSiteName = ""Â Then strSiteName = "CMS"
If Application(strSiteName &Â "_Page" &Â appPageNum) = ""Â Then GFDB = True
If Application(strSiteName &Â "_Content" &Â appPageNum) = ""Â Then GFDB = True
%>
<%
intStart = timer
If Request("ap") <>Â "" Then
      If Session("xpage") <> "" Then
           appPageNum = Session("xpage")
           GFDB = False
      End If
End If
Session("xpage") = ""
MyWebPage = ""
IsPageDynamic = 0
MyVisitors = Application("ActiveUsers")
MyDate = FormatDateTime(Date(), vbLongDate)
Page_Content = ""
MyScript = "<"Â + chr(37) + "Server.Execute({ASP_page_
MyResultsPageScript = "<% Server.Execute(""ASP\"" &Â Request.QueryString(""ap""
'*************************
' Start of Get From Database
'*************************
If GFDB Then
Function GetFldData(fldnum,varCheck
      Dim RecFound, ipage
      RecFound = False
      For ipage = 0 to numrows
           If MyPages(fldnum,ipage) = varCheck Then
                 RecFound = True
                 Exit For
           End If
      Next
      If NOT Recfound Then ipage = -1
      GetFldData = ipage
End Function
Function GetFldData2(fldnum2,varChe
      Dim RecFound2, jpage
      RecFound2 = False
      For jpage = 0 to numrows2
           If MyTemplates(fldnum2,jpage)
                 RecFound2 = True
                 Exit For
           End If
      Next
      If NOT Recfound2 Then jpage = -1
      GetFldData2 = jpage
End Function
Dim com, rsTemplate, MyPages, rsTmplts, numrows, numrows2
Set con = Server.CreateObject("ADODB
con.Open MM_connCMS_STRING
Set rsTemplate = con.Execute("SELECT * FROM qryTemplate_Content")
MyPages = rsTemplate.GetRows()
rsTemplate.close()
Set rsTemplate = Nothing
Set rsTmplts = con.Execute("SELECT * FROM CMS_Templates")
MyTemplates = rsTmplts.GetRows()
rsTmplts.close()
Set rsTmplts = Nothing
con.Close
Set con = Nothing
numrows=ubound(MyPages,2)
numrows2=ubound(MyTemplate
If appPageNum = "0" Then
      rownum = GetFldData(7,1)
Else
      rownum = GetFldData(0,CInt(appPageN
End If
If rownum >Â -1 Then
      Dim MyWebPageID, MyDocTitle, MyASPpage, MyPageTitle, MyPageHeadContent, MyBgcolor
      Dim Page_Template, ParentPage, MyRegistration, strDCmenuH, strDCmenuH1, strDCmenuH2
      Dim strDCmenuV, strDCmenuV1, strDCmenuV2, MyMainMenu, MyDivider, MySubMenu, MyBullet
      Dim MyVar1, MyVar2, MyVar3, MyToken1, MyMenu1, MyMenuID1, MyBC, MyBCdivider, WasHomePage
      Dim MySearch
      MyWebPageID = MyPages(0,rownum)
      MyDocTitle = MyPages(5,rownum)
      MyASPpage = MyPages(14,rownum)
      Application.Lock
      Application(strSiteName & "_ASPPage" & CStr(MyWebPageID)) = MyASPpage
      Application.UnLock
      MyPageTitle = MyPages(2,rownum)
      MyPageHeadContent = MyPages(12,rownum)
      If MyPages(18,rownum) = 1 Then
           MyPrSc = "<!-- {IsPrivate} -->" & vbCrlf & ""
           MyPageHeadContent = MyPrSc & MyPageHeadContent
      End If
      MyBgcolor = MyPages(4,rownum)           Â
      Page_Template = MyPages(3,rownum)
      Page_Content = MyPages(6,rownum)
      MyWebPage = Replace(Page_Template,"{Co
      ParentPage = MyPages(8,rownum)
      MyRegistration = MyPages(16,rownum)
      If ParentPage > 0 and Not IsNull(ParentPage) Then
           rownum2 = GetFldData2(0,ParentPage)
           While rownum2 > -1
                 MyWebPage = Replace(MyTemplates(2,rown
                 ParentPage = MyTemplates(6,rownum2)
                 MyBgcolor = MyTemplates(3,rownum2)
                 rownum2 = GetFldData2(0,ParentPage)
           Wend
      End If
      If (InStr(1,MyWebPage,"{hMenu
           strDCmenuH = "<script type=""text/javascript"">"
           strDCmenuH = strDCmenuH & "var m1 = new COOLjsMenuPRO(""menu1"", MENU_ITEMS)" & vbCrLf
           strDCmenuH = strDCmenuH & "m1.initTop();" & vbCrLf
           strDCmenuH = strDCmenuH & "</script>" & vbCrLf
           strDCmenuH = strDCmenuH & "<script type=""text/javascript"">"
           strDCmenuH = strDCmenuH & "m1.init();" & vbCrLf
           strDCmenuH = strDCmenuH & "m1.show();" & vbCrLf
           strDCmenuH = strDCmenuH & "</script>" & vbCrLf
           strDCmenuH1 = strDCmenuH1 & "<LINK href=""CMSmenu/style.css""
           strDCmenuH1 = strDCmenuH1 & "<SCRIPT src=""CMSmenu/menu.js"" type=text/javascript></SCR
           strDCmenuH1 = strDCmenuH1 & "<SCRIPT src=""ASP/menuitems.JS"" type=text/javascript></SCR
           MyWebPage = Replace(MyWebPage,"{hMenu}
           MyPageHeadContent = Replace(MyPageHeadContent,
      End If
      If (InStr(1,MyWebPage,"{vcMen
           strDCmenuV = "<SCRIPT type=text/javascript>" & vbCrLf
           strDCmenuV = strDCmenuV & "var tree = new COOLjsTreePRO(""tree1"", TREE1_NODES, TREE1_FORMAT);" & vbCrLf
           strDCmenuV = strDCmenuV & "tree.init();" & vbCrLf
           strDCmenuV = strDCmenuV & "</SCRIPT>"
           strDCmenuV1 = strDCmenuV1 & "<link href=""CMSmenu/menuv.css""
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv.js""><
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv_format
           strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""ASP/menuv_nodes.js""
           strDCmenuV2 = strDCmenuV2 & "<script language=""JavaScript"">Re
           MyWebPage = Replace(MyWebPage,"{vcMenu
           MyPageHeadContent = Replace(MyPageHeadContent,
           MyPageHeadContent = Replace(MyPageHeadContent,
      End If
      If (InStr(1,MyWebPage,"{MainM
           MyMainMenu = ""
           MyDivider = " | "
           For i = 0 to numrows
                 If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                      If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                      MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{MainMe
           Page_Content = Replace(Page_Content,"{Mai
      End If
      If (InStr(1,MyWebPage,"{MainM
           MySubMenu = ""
           MyBullet = "•" & " "
           For i = 0 to numrows
                 If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                      MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{MainMe
           Page_Content = Replace(Page_Content,"{Mai
      End If
      If (InStr(1,MyWebPage,"{Subme
           MyMainMenu = ""
           MyDivider = "•" & " "
           For i = 0 to numrows
                 If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                      MyMainMenu = MyMainMenu & MyDivider & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A><br>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{Submen
           Page_Content = Replace(Page_Content,"{Sub
      End If
      If (InStr(1,MyWebPage,"{hSubm
           MyMainMenu = ""
           MyDivider = " | "
           For i = 0 to numrows
                 If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                      If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                      MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                 End If
           Next
           MyWebPage = Replace(MyWebPage,"{hSubme
           Page_Content = Replace(Page_Content,"{hSu
      End If
      If (InStr(1,Page_Content,"{{S
           MyVar1 = InStr(1,Page_Content,"{{Su
           MyVar2 = MyVar1 + 10
           MyVar3 = InStr(1,Page_Content,"}}")
           MyToken1 = Mid(Page_Content,MyVar1,(M
           MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MySubMenu = ""
                 MyBullet = "•" & " "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                      End If
                 Next
                 Page_Content = Replace(Page_Content,MyTok
           End If
      End If
      If (InStr(1,MyWebPage,"{{Subm
           MyVar1 = InStr(1,MyWebPage,"{{Subme
           MyVar2 = MyVar1 + 10
           MyVar3 = InStr(1,MyWebPage,"}}")
           MyToken1 = Mid(MyWebPage,MyVar1,(MyVa
           MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MySubMenu = ""
                 MyBullet = "•" & " "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                      End If
                 Next
                 MyWebPage = Replace(MyWebPage,MyToken1
           End If
      End If
      If (InStr(1,Page_Content,"{{h
           MyVar1 = InStr(1,Page_Content,"{{h"
           MyVar2 = MyVar1 + 11
           MyVar3 = InStr(1,Page_Content,"}}")
           MyToken1 = Mid(Page_Content,MyVar1,(M
           MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MyMainMenu = ""
                 MyDivider = " | "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                            MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                      End If
                 Next
                 Page_Content = Replace(Page_Content,MyTok
           End If
      End If
      If (InStr(1,MyWebPage,"{{hSub
           MyVar1 = InStr(1,MyWebPage,"{{h")
           MyVar2 = MyVar1 + 11
           MyVar3 = InStr(1,MyWebPage,"}}")
           MyToken1 = Mid(MyWebPage,MyVar1,(MyVa
           MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
           rownum = GetFldData(2,MyMenu1)
           If rownum > -1 Then
                 MyMenuID1 = MyPages(0,rownum)
                 MyMainMenu = ""
                 MyDivider = " | "
                 For i = 0 to numrows
                      If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                            If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                            MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                      End If
                 Next
                 MyWebPage = Replace(MyWebPage,MyToken1
           End If
      End If
      If (InStr(1,MyWebPage,"{Bread
           ParentPage = MyWebPageID
           MyBC = ""
           MyBCdivider = " > "
           WasHomePage = 1
           rownum = GetFldData(0,ParentPage)
           While ParentPage <> 0
                 If MyBC <> "" Then MyBC = MyBCdivider & MyBC
                 MyBC = "<a href='Default.asp?Page=" & MyPages(0,rownum) & "'>" & MyPages(2,rownum) & "</a>" & MyBC
                 ParentPage = MyPages(9,rownum)
                 If ParentPage = 0 and MyPages(7,rownum) = 0 Then
                      WasHomePage = 0
                 End If
                 rownum = GetFldData(0,ParentPage)           Â
           Wend
           If WasHomePage = 0 Then
                 MyBC = "<a href='Default.asp'>Home</a
           End If           Â
           MyWebPage = Replace(MyWebPage,"{Breadc
           Page_Content = Replace(Page_Content,"{Bre
      End If
      If (InStr(1,MyWebPage,"{Searc
           MySearch = ""
           MySearch = MySearch + "<form name=" + Chr(34) + "SearchForm" + Chr(34) + " method=" + Chr(34) + "post" + Chr(34) + " action=" + Chr(34) + "default.asp" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "Site Search<br>" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "CMSsearch" + Chr(34) + " type=" + Chr(34) + "text" + Chr(34) + " size=" + Chr(34) + "12" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "CMS_search" + Chr(34) + " type=" + Chr(34) + "submit" + Chr(34) + " id=" + Chr(34) + "CMS_search" + Chr(34) + " value=" + Chr(34) + "Go" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "Page" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + CStr(MyWebPageID) + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "<input name=" + Chr(34) + "Search" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + "true" + Chr(34) + ">" + VbCrLf
           MySearch = MySearch + "</form>"
           MyWebPage = Replace(MyWebPage,"{Search
           Page_Content = Replace(Page_Content,"{Sea
      End If
      MyWebPage = Replace(MyPageHeadContent,
      MyWebPage = Replace(MyWebPage,"{bgcolo
      MyWebPage = Replace(MyWebPage,"{DocTit
      MyWebPage = Replace(MyWebPage,"{PageTi
      MyWebPage = Replace(MyWebPage,"{Regist
      Page_Content = Replace(Page_Content,"{Pag
      Page_Content = Replace(Page_Content,"{Reg
      Application.Lock
      Application(strSiteName & "_Page" & CStr(MyWebPageID)) = MyWebPage
      Application(strSiteName & "_Content" & CStr(MyWebPageID)) = Page_Content
      Application.UnLock
Else
      MyWebPage = "That Web Page is not Found."
End If
Set MyPages = Nothing
Set MyTemplates = Nothing
Else
      MyWebPage = Application(strSiteName & "_Page" & appPageNum)
      Page_Content = Application(strSiteName & "_Content" & appPageNum)
      MyASPpage = Application(strSiteName & "_ASPPage" & appPageNum)
End If
'*************************
' End of Get From Database
'*************************
IsPageResults = False
ExecuteExternalASPpage = False
If Request("ap") <>Â "" Then MyASPpage = Request("ap")
If MyASPpage <>Â "" Then IsPageResults = True
RunScript = "RunScript.asp"
If MyASPpage <>Â "" Then
      ExecuteExternalASPpage = True
End If
If Request.QueryString <>Â "" Then RunScript = RunScript + "?" + Request.QueryString
If Request.QueryString("msg")
      Page_Content = Request.QueryString("msg")
      IsPageResults = True
End If
Function MakeQS(fvar,fvarname,fpage
      NewQS = fvar
      AddParam = True
      If (InStr(1,fvar,"?") > 0) Then
           MyParams1 = Mid(fvar,InStr(1,fvar,"?")
           MyParams = Split(MyParams1,"&")
           AddParam = True
           For Each i in MyParams
                 If Ucase(Left(i,InStr(1,i,"="
           Next
      End If
      If AddParam Then
           If (InStr(1,fvar,"?") > 0) Then
                 NewQS = fvar + "&" + fvarname + "=" + fpage
           Else
                 NewQS = fvar + "?" + fvarname + "=" + fpage
           End If
      End If
      MakeQS = NewQS
End Function
Function InsertASPpage(fntoken,fnpa
      InsertASPpage = Replace(MyWebPage,fntoken,
End Function
Function DisplayTokenByType(strT1, strT2, strASPpg, strType)
      DisplayTokenByType = False
      If InStr(1,MyWebPage,strT1) > 0 Then
           intVar = Len(strT1)
           IsPageDynamic = 1
           intVar1 = InStr(1,MyWebPage,strT1)
           intVar3 = InStr(1,MyWebPage,strT2)
           strToken = Mid(MyWebPage,intVar1,intV
           strTokenType = Mid(strToken,InStr(1,strTo
           strTokenType = Mid(strTokenType,1,InStr(1
           MyWebPage = InsertASPpage(strToken,str
           If (InStr(1,RunScript,strType
                 RunScript = MakeQS(RunScript,strType,s
           End If
           DisplayTokenByType = True
      End If
End Function
If Request("ap") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("AR") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("NWS")
If Request.QueryString("PR") <>Â "" Then Page_Content = "{Dynamic}"
If Request.QueryString("ce") <>Â "" Then Page_Content = "{Dynamic}"
If Request.Form("Search") <>Â "" Then Page_Content = "{#%SearchResults}"
If Request.QueryString("FAQ")
IsHelpDesk = False
If (InStr(1,Page_Content,"{He
      IsHelpDesk = True
      Page_Content = "{Dynamic}"
End If
AllowAccess = True
If ((InStr(1,MyWebPage,"{IsPr
      Session("xpage") = appPageNum
      If Session("LoggedIn") <> "Yes" Then
           AllowAccess = False
           Page_Content = "{Dynamic}"
      End If
End If
MyWebPage = Replace(MyWebPage,"{PageCo
If Request.Form("Search") <>Â "" Then
      Set con = Server.CreateObject("ADODB
       con.Open MM_connCMS_STRING
  Set rsSearch = con.Execute("SELECT CMS_ID,CMS_Name FROM WebContent WHERE CMS_Active = 1 AND CMS_Content LIKE '%" & Request.Form("CMSsearch") & "%'")
      MySCounter = 1
      MySR = "<strong>Search Results</strong><br><br>"
      If Not rsSearch.eof Then
           While Not rsSearch.eof
                 MySR = MySR + CStr(MySCounter) + ". - <a href=" + Chr(34) + "Default.asp?Page=" + CStr(rsSearch("CMS_ID")) + Chr(34) + ">" + rsSearch("CMS_Name") + "</a><br>"
                 rsSearch.MoveNext()
                 MySCounter = MySCounter + 1
           Wend
      Else
           MySR = MySR + "No Pages Match Your Search..."
      End If
      Set rsSearch = Nothing
      con.Close
  Set con = Nothing
      MyWebPage = Replace(MyWebPage,"{#%Sear
      GFDB = True
End If
If InStr(1,MyWebPage,"{Dynami
      IsPageDynamic = 1
      Session("xpage") = appPageNum
      IsPageResults = True
End If
MyWebPage = Replace(MyWebPage,"{Dynami
PageName = "ASP\Pg" &Â appPageNum &Â ".asp"
If IsPageResults Then PageName = "ASP\~Pg" &Â appPageNum &Â ".asp"
If ExecuteExternalASPpage Then
      PageName = "ASP\~PgDefault.asp"
      If Request("ap") = "" Then
           RunScript = MakeQS(RunScript,"ap",MyAS
      End If
End If
If IsHelpDesk Then
      If AllowAccess Then
           RunScript = MakeQS(RunScript,"ap","HD_
      Else
           RunScript = MakeQS(RunScript,"ap","Mem
      End If
End If
If Not AllowAccess Then RunScript = MakeQS(RunScript,"ap","Mem
'*************************
' Start of Prepare file for Write
'*************************
      If Request.QueryString("AR") <> "" Then
           RunScript = MakeQS(RunScript,"ap","New
      End If
      If Request.QueryString("NWS")
           RunScript = MakeQS(RunScript,"ap","New
      End If
      If Request.QueryString("PR") <> "" Then
           RunScript = MakeQS(RunScript,"ap","Dis
      End If
      If Request.QueryString("ce") <> "" Then
           RunScript = MakeQS(RunScript,"ap","Dis
      End If
      If Request.QueryString("FAQ")
           RunScript = MakeQS(RunScript,"ap","FAQ
      End If
      If InStr(1,MyWebPage,"{NewsAr
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsArticl
      End If
      If InStr(1,MyWebPage,"{NewsAr
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsArticl
      End If
      If InStr(1,MyWebPage,"{NewsCa
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{NewsCat}",
      End If
      MyPhantomVar = DisplayTokenByType("{News2
      MyPhantomVar = DisplayTokenByType("{News=
      If InStr(1,MyWebPage,"{FAQcat
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{FAQcat}","
      End If
      MyPhantomVar = DisplayTokenByType("{FAQ="
      MyPhantomVar = DisplayTokenByType("{Calen
      MyPhantomVar = DisplayTokenByType("{Calen
      If InStr(1,MyWebPage,"{%Poll=
           IsPageDynamic = 1
           PollVar1 = InStr(1,MyWebPage,"{%")
           PollVar2 = PollVar1 + 7
           PollVar3 = InStr(1,MyWebPage,"%}")
           MyPollToken = Mid(MyWebPage,PollVar1,(Po
           MyPoll = Mid(MyPollToken,8,(PollVar
           MyWebPage = InsertASPpage(MyPollToken,
           RunScript = MakeQS(RunScript,"Poll_ID"
      End If
      If InStr(1,MyWebPage,"{Calend
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{Calendar2}
      End If
      If InStr(1,MyWebPage,"{Calend
           IsPageDynamic = 1
           MyWebPage = InsertASPpage("{Calendar}"
      End If
'*************************
' End of Prepare file for Write
'*************************
intEnd = timer
MyTimer = FormatNumber(intEnd - intStart,4)
MyWebPage = Replace(MyWebPage,"{Timer}
If IsPageDynamic = 1 Then
      MyWebPage = Replace(MyWebPage,"{Date}"
      MyWebPage = Replace(MyWebPage,"{Active
      Set objFSO = Server.CreateObject("Scrip
      If GFDB Or Not objFSO.FileExists(Server.M
           Set objText = objFSO.OpenTextFile(Server
           objText.Write MyWebPage
           objText.Close
           Set objText = Nothing
      End If
      Set objFSO = Nothing
      RunScript = MakeQS(RunScript,"p",PageN
      'RunScript = MakeQS(RunScript,"page",My
      'Response.Write(Runscript)
      'Response.End()
      Response.Redirect(RunScrip
End If
MyWebPage = Replace(MyWebPage,"{Date}"
MyWebPage = Replace(MyWebPage,"{Active
Response.Write(MyWebPage)
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Response.CacheControl = "Public"
put
Response.charset = "iso-8859-7 "