Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mixed usage of Code Page values

Status
Not open for further replies.

3299

Technical User
May 24, 2008
3
Hellow everyone :) Im reeeally new in programming (actually I finnaly decided to understand it after this problem :p ) which means I know very little about it :(. Some time ago a friend helped me to make a login page for a section of a website I use to orgnize part of my work, It used to work really well on ASP Baby Server but now I need to use IIS on my machine and it has given me the following error eversince:

Active Server Pages error 'ASP 0245'
---------------------------------------------------------
Mixed usage of Code Page values

/scripts/logon.asp, line 1

The @CODEPAGE value specified differs from that of the including file's CODEPAGE or the file's saved format.
---------------------------------------------------------Like I said I have no idea what he is talking about :( I`ve post the code of the logon script, if theres sum1 out there that can help me id be so immenselly grateful :)
Ps.: I tried to take off the 1st line with no sucess :( the erro message was:
---------------------------------------------------------

Active Server Pages error 'ASP 0131'

Disallowed Parent Path

/scripts/logon.asp, line 1

The Include file '../Connections/AKPI.asp' cannot contain '..' to indicate the parent directory
----------------------------------------------------------

Here is the logon script:
********************************************************************************
************

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/AKPI.asp" -->
<%
Dim rs_Login__MMColParam
rs_Login__MMColParam = "0"
If (Request.Form("user") <> "") Then
rs_Login__MMColParam = Request.Form("user")
End If
%>
<%
Dim rs_Login__MMColParam2
rs_Login__MMColParam2 = "0"
If (Request.Form("password") <> "") Then
rs_Login__MMColParam2 = Request.Form("password")
End If
%>
<%
Dim rs_Login
Dim rs_Login_numRows

sql = "SELECT u.UserID, u.SurName, u.Name, t.Team, u.NameCountry, u.Group, c.ImgName, u.active, u.language_id, u.CodTeam "&_
"FROM Tb_User u, Tb_Team t, Tb_Country c WHERE u.CodTeam = t.CodTeam AND u.NameCountry = c.NameCountry "&_
" AND u.UserID = '" + Replace(rs_Login__MMColParam, "'", "''") + "' AND u.Password = '" + Replace(rs_Login__MMColParam2, "'", "''") + "' and active = true"

Set rs_Login = Server.CreateObject("ADODB.Recordset")
rs_Login.ActiveConnection = MM_AKPI_STRING
rs_Login.Source = sql
rs_Login.CursorType = 0
rs_Login.CursorLocation = 2
rs_Login.LockType = 1
rs_Login.Open()

rs_Login_numRows = 0
%>

<% 'if (rs_Login.Fields.Item("UserID").Value = rs_Login__MMColParam) then
if (NOT rs_Login.EOF) then

Session("login_ok") = True
Session("UserID") = rs_Login.Fields.Item("UserID").Value
Session("fullName") = rs_Login.Fields.Item("SurName").Value & ", " & rs_Login.Fields.Item("Name").Value
Session("Country") = rs_Login.Fields.Item("NameCountry").Value
Session("Group") = rs_Login.Fields.Item("Group").Value
Session("Team") = rs_Login.Fields.Item("Team").Value
Session("CodTeam") = rs_Login.Fields.Item("CodTeam").Value
Session("ImgName") = rs_Login.Fields.Item("ImgName").Value
session("language") = rs_Login.Fields.Item("language_id").Value


'Response.Write(Session("Team"))
Response.Redirect("../default.asp") %>
<% Else %>
<% Response.Redirect("../wronglogin.asp") %>
<% End If %>

<%
rs_Login.Close()
Set rs_Login = Nothing
%>
 
Hi and welcome to Tek-Tips. Please read faq222-2244 to see how to get the best from these forums.

For this problem, your server is set to disallow parent directory access. This is a normal security precaution. Make a directory called Connections directly under the site root directory. Move your AKPI.asp file to that directory. The change your first 2 lines to:
Code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/AKPI.asp" -->

Come back if that doesn't solve it all. It's also worth reading up on some basic stuff. Try where you will find some good basic tutorials.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
WOW!!! OMG John!!! Im reaaly really thankfull :D you were right on the spot :)
Thanks 1000 times
 
Ow just one more question... Im having a problem with a Popup on the logon page... when I use firefox it work really great.. but when I use any version of IE it doesnt is there a way to make is work on both browsers? Heres the code that im using to generate the popup window:

------------------------------------------------------------------------------------------------------------------------------------------------------

response.write("<scr" & "ipt>" & vbCrLf)
response.write("open(""..//centre/agentscenter.asp"",""Agents Center"",""width=780,height=650,scrollbars=no"");" & vbCrLf)
response.write("</scr" & "ipt>") %>
------------------------------------------------------------------------------------------------------------------------------------------------------


Its the same page... the logon.asp I just changed the response.redirect

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="AKPI.asp" -->
<%
Dim rs_Login__MMColParam
rs_Login__MMColParam = "0"
If (Request.Form("user") <> "") Then
rs_Login__MMColParam = Request.Form("user")
End If
%>
<%
Dim rs_Login__MMColParam2
rs_Login__MMColParam2 = "0"
If (Request.Form("password") <> "") Then
rs_Login__MMColParam2 = Request.Form("password")
End If
%>
<%
Dim rs_Login
Dim rs_Login_numRows

sql = "SELECT u.UserID, u.SurName, u.Name, t.Team, u.NameCountry, u.Group, c.ImgName, u.active, u.language_id, u.CodTeam "&_
"FROM Tb_User u, Tb_Team t, Tb_Country c WHERE u.CodTeam = t.CodTeam AND u.NameCountry = c.NameCountry "&_
" AND u.UserID = '" + Replace(rs_Login__MMColParam, "'", "''") + "' AND u.Password = '" + Replace(rs_Login__MMColParam2, "'", "''") + "' and active = true"

Set rs_Login = Server.CreateObject("ADODB.Recordset")
rs_Login.ActiveConnection = MM_AKPI_STRING
rs_Login.Source = sql
rs_Login.CursorType = 0
rs_Login.CursorLocation = 2
rs_Login.LockType = 1
rs_Login.Open()

rs_Login_numRows = 0
%>

<% 'if (rs_Login.Fields.Item("UserID").Value = rs_Login__MMColParam) then
if (NOT rs_Login.EOF) then

Session("login_ok") = True
Session("UserID") = rs_Login.Fields.Item("UserID").Value
Session("fullName") = rs_Login.Fields.Item("SurName").Value & ", " & rs_Login.Fields.Item("Name").Value
Session("Country") = rs_Login.Fields.Item("NameCountry").Value
Session("Group") = rs_Login.Fields.Item("Group").Value
Session("Team") = rs_Login.Fields.Item("Team").Value
Session("CodTeam") = rs_Login.Fields.Item("CodTeam").Value
Session("ImgName") = rs_Login.Fields.Item("ImgName").Value
session("language") = rs_Login.Fields.Item("language_id").Value


response.write("<scr" & "ipt>" & vbCrLf)
response.write("open(""..//centre/agentscenter.asp"",""Agents Center"",""width=780,height=650,scrollbars=no"");" & vbCrLf)
response.write("</scr" & "ipt>") %>


<% Else %>
<% Response.Redirect("../wronglogin.asp") %>
<% End If %>

<%
rs_Login.Close()
Set rs_Login = Nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top