Ideas anyone?

S

Steven Burn

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)
 
R

Ray at

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
 
S

Steven Burn

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)
 
S

Steven Burn

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Response. and Request. 2
Block "HEAD" method? 2
Replace Function 6
use the oleDBCommand in ASP 2
[OT] Server 2003 + Access 23
Just wondering 11
IsNumeric problem.... 5
IIS 4

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top