absolutmgd13
06-16-2009, 01:55 PM
I want to write something to do the following.
I have a list of referrers (yahoo.com, google.com, ect.)
I have a page that displays the referrer now:
<%@page import="java.net.InetAddress;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%
out.println(request.getHeader("Referer"));
%>
What i want to happen is, if i come from yahoo i want to import/load content, either an external html or maybe content from an array into the html page displaying the referrer.
i try to get to my page from yahoo, but denied access so you see the referrer, then a imported or loaded message saying why you cant come from yahoo..
same with the rest of the referrers..
being new to java i tried to write this as simply as possible to give you an idea of what im trying to do
<%
out.println(request.getHeader("Referer") + "<br /><br />");
String[] appError=new String[3];
appError[1] = "no from yahoo because...";
appError[2] = "no from google because...";
appError[3] = "no from msn because...";
if (Referer != [www.yahoo.com]) {
out.println(appError[1]);
}
if (Referer != [www.google.com]) {
out.println(appError[2]);
}
if (Referer != [www.msn.com]) {
out.println(appError[3]);
}
%>
any help would be greatly appreciated!
I've also tried this
<%@page import="java.net.InetAddress;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%
out.println(request.getHeader("Referer") + "<br /><br />");
String[] appError=new String[3];
appError[1] = "no from yahoo because...";
appError[2] = "no from google because...";
appError[3] = "no from msn because...";
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
int i=Referer;
for(i=Referer;i<appError.length;i++)
{
out.print("app Error is: " + appError[i] + "<br/>");
}
%>
</BODY>
</HTML>
I have a list of referrers (yahoo.com, google.com, ect.)
I have a page that displays the referrer now:
<%@page import="java.net.InetAddress;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%
out.println(request.getHeader("Referer"));
%>
What i want to happen is, if i come from yahoo i want to import/load content, either an external html or maybe content from an array into the html page displaying the referrer.
i try to get to my page from yahoo, but denied access so you see the referrer, then a imported or loaded message saying why you cant come from yahoo..
same with the rest of the referrers..
being new to java i tried to write this as simply as possible to give you an idea of what im trying to do
<%
out.println(request.getHeader("Referer") + "<br /><br />");
String[] appError=new String[3];
appError[1] = "no from yahoo because...";
appError[2] = "no from google because...";
appError[3] = "no from msn because...";
if (Referer != [www.yahoo.com]) {
out.println(appError[1]);
}
if (Referer != [www.google.com]) {
out.println(appError[2]);
}
if (Referer != [www.msn.com]) {
out.println(appError[3]);
}
%>
any help would be greatly appreciated!
I've also tried this
<%@page import="java.net.InetAddress;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%
out.println(request.getHeader("Referer") + "<br /><br />");
String[] appError=new String[3];
appError[1] = "no from yahoo because...";
appError[2] = "no from google because...";
appError[3] = "no from msn because...";
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
int i=Referer;
for(i=Referer;i<appError.length;i++)
{
out.print("app Error is: " + appError[i] + "<br/>");
}
%>
</BODY>
</HTML>