470,613 Members | 2,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

Ideas anyone?

Basically, I am trying to get the following code working, and for the life
of me, I can't figure out where I've gone wrong.

<%
If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then
<!--#include file="banner.asp"-->
Else
Response.Write "This file does not support hotlinking"
End If
%>

I know it is probably something completely simple, and there's probably a
better way of doing this but, I'm half asleep, stressed to holy hell with my
Tiscali HamsterBand service etc.

Basically, all it is meant to do is allow the include tag if the page
calling it is on the server, and show the message if it is on another
server.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Jul 19 '05 #1
4 1852
Includes are done outside of the ASP script blocks. IE:
<% If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then %>
<!--#include file="banner.asp"-->
<%
Else
Response.Write "This file does not support hotlinking"
End If
%>

Although I believe you already know this, the include will be included
regardless of that condition, but the code won't be executed, so this'll
still be fine. Also, you can you server.Execute "banner.asp" as an
alternative, depending on what it is that banner.asp is doing.

Ray at home

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Basically, I am trying to get the following code working, and for the life
of me, I can't figure out where I've gone wrong.

<%
If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then
<!--#include file="banner.asp"-->
Else
Response.Write "This file does not support hotlinking"
End If
%>

I know it is probably something completely simple, and there's probably a
better way of doing this but, I'm half asleep, stressed to holy hell with my Tiscali HamsterBand service etc.

Basically, all it is meant to do is allow the include tag if the page
calling it is on the server, and show the message if it is on another
server.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #2
Cheers Ray.

banner.asp is basically just a page with rotator code (top right gold frame
of my site), nothing particularly special.

I didn't actually want to have to do this sort of thing but, I've got people
using it on their own site, and without asking, which is annoying the heck
out of me.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Ray at <%=sLocation%> <myfirstname at lane 34 . komm> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Includes are done outside of the ASP script blocks. IE:
<% If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then %>
<!--#include file="banner.asp"-->
<%
Else
Response.Write "This file does not support hotlinking"
End If
%>

Although I believe you already know this, the include will be included
regardless of that condition, but the code won't be executed, so this'll
still be fine. Also, you can you server.Execute "banner.asp" as an
alternative, depending on what it is that banner.asp is doing.

Ray at home

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Basically, I am trying to get the following code working, and for the life of me, I can't figure out where I've gone wrong.

<%
If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then
<!--#include file="banner.asp"-->
Else
Response.Write "This file does not support hotlinking"
End If
%>

I know it is probably something completely simple, and there's probably a better way of doing this but, I'm half asleep, stressed to holy hell
with my
Tiscali HamsterBand service etc.

Basically, all it is meant to do is allow the include tag if the page
calling it is on the server, and show the message if it is on another
server.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Jul 19 '05 #3
Public Function ProcessUrl()
If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then
strUrlAddress = "http://www.it-mate.co.uk/main_content/banner.asp"
On Error Resume Next
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "GET",strUrlAddress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
End If
End Function

--
-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #4
Thanks but, there's no need for all of that code, Ray's correction worked
;o)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
dlbjr <do******@do.u> wrote in message news:iDbub.197$Qy4.14783@typhoon01...
Public Function ProcessUrl()
If Server.RequestVariables("HTTP_REFERER") =
"http://www.it-mate.co.uk/main_content/right.asp" Then
strUrlAddress = "http://www.it-mate.co.uk/main_content/banner.asp"
On Error Resume Next
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "GET",strUrlAddress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
End If
End Function

--
-dlbjr

Discerning resolutions for the alms

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jaime Wyant | last post: by
2 posts views Thread by John Smity | last post: by
10 posts views Thread by Mark | last post: by
8 posts views Thread by Brandon McGinty | last post: by
reply views Thread by mistersexy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.