This topic is locked
[SOLVED]

 Variable header script doesn't work

2/26/2010 10:15:37 AM
ASPRunnerPro General questions
T
text author

Hi
I am using the latest build of 6.2 and am trying to change the header of the login page login.asp from the standard header that I have in the rest of the site. I have inserted the code below in my header.asp file that I found from doing a forum search but it doesn't seem to work. Is there anything obviously wrong with the code below:
<%
if Request.ServerVariables("SCRIPT_NAME")= "login.asp" then

%><!-- #include file="header1.asp" --><%

end if

%>
Thanks very much
Richard

T
text author 3/1/2010



Hi
I am using the latest build of 6.2 and am trying to change the header of the login page login.asp from the standard header that I have in the rest of the site. I have inserted the code below in my header.asp file that I found from doing a forum search but it doesn't seem to work. Is there anything obviously wrong with the code below:
<%
if Request.ServerVariables("SCRIPT_NAME")= "login.asp" then

%><!-- #include file="header1.asp" --><%

end if

%>
Thanks very much
Richard


Please can someone let me know if in theory this code should work with the login page.
thanks

Sergey Kornilov admin 3/1/2010

Request.ServerVariables("SCRIPT_NAME") contains script name with path. You need to remove the path part first.
Try this:



<%
arPath = Split(Request.ServerVariables("SCRIPT_NAME"), "/")

FileName =arPath(UBound(arPath,1))
if FileName= "login.asp" then

%><!-- #include file="header1.asp" --><%

end if

%>
T
text author 3/2/2010



Request.ServerVariables("SCRIPT_NAME") contains script name with path. You need to remove the path part first.
Try this:



<%
arPath = Split(Request.ServerVariables("SCRIPT_NAME"), "/")

FileName =arPath(UBound(arPath,1))
if FileName= "login.asp" then

%><!-- #include file="header1.asp" --><%

end if

%>




fantastic thx very much Sergey