PDA

View Full Version : Link And Http Referer



Ariel_001
02-10-2004, 04:43 PM
If I set a link with a target that opens like this (http://www.google.com) in a new window will the website (i.e google) know what the referring website is.

h1
02-10-2004, 05:27 PM
Depends on your browser, but for the most part yes. :)

Ariel_001
02-10-2004, 11:16 PM
# 0000000034 - TIME: 10.02.2004 - 17:22:49 IP: (IP) DNS-Name: (DNS-NAME) Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) FROM: http://filesharingtalk.com/index.php?showt...=0&#entry866763 (http://filesharingtalk.com/index.php?showtopic=99313&st=0&#entry866763)


I guess your are right. Would you (or anybody) know how to stop a website from knowing what the referring website is.

MUSLEMAN
02-11-2004, 04:50 PM
use a good proxy

Ariel_001
02-11-2004, 05:12 PM
Originally posted by MUSLEMAN@11 February 2004 - 16:50
use a good proxy
That not going to do me any good. I want my website to have links to other website but i do not what the other website to know that the referring website is mine.

vivitron 15
02-11-2004, 06:32 PM
it should be possible to create a seperate page to load them from - as long as you can get a php enabled page which isnt located with your website (maybe a free service)

the code on your page to link to google would be stg like this:



<a href="http://www.dumbpage.com/page.php?ref=http://www.google.com">Google</a>

then the dummy page would have code with



<?php
if ($_GET["ref"]) { $ref=$_GET["ref"] };

print("<meta http-equiv='refresh' content='0; url=$ref'>");

?>

Now i havent checked this, but i reckon it should work

Ariel_001
02-11-2004, 09:50 PM
Parse error: parse error, unexpected '}' in /sda3-dev/webpages/departments/pdht/pdhtstudentwebpages/ariel_llamado/redirect.php on line 2

does not seem to work :frusty: . do you know what is wrong ?

Ynhockey
02-11-2004, 10:48 PM
Chage:

if ($_GET["ref"]) { $ref=$_GET["ref"] };

to:

if ($_GET["ref"]) { $ref=$_GET["ref"]; }

h1
02-11-2004, 10:52 PM
It should be:


<?php
$refresh = "";
$style = "";
$text = "";
$title = "";
if (!(isset($_GET[ref])))
{
$refresh = "";
$style = "\n\t\t\t\tcolor : #000000;\n\t\t\t\tfont-family : arial;\n\t\t\t\tfont-size : 12px;\n\t\t\t\tfont-weight : normal;\n\t\t\t\ttext-align : justify;\n\t\t\t\ttext-decoration : none;\n\t\t\t\ttext-style : normal;";
$text = "\n\t\tError: A URL was not specified.";
$title = "Error";
}
else
{
$refresh = "\n\t\t\t<meta http-equiv=\"refresh\" content=\"0; url=".$ref."\" />";
$style = "";
$text = "";
$title = "Redirecting...";
}

print("<"."?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?".">");
?>
<!doctype html public "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1.1-strict.dtd" />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
<head>
 <meta name="author" content="haxor41789" />
 <meta http-equiv="content-type" content="application/xml+xhtml; charset=UTF-8" /><?php print($refresh); ?>
 <title><?php print($title); ?></title>
 <style type="text/css" media="screen">
  html, body
  {
   background-color : #ffffff;
   border : 0ex #ffffff solid;<?php print($style); ?>
  }
 </style>
</head>
<body><?php print($text); ?>
</body>
</html>

I doubt if this works, as I did this really fast. :P

vivitron 15
02-12-2004, 12:52 AM
as far as i can see that's just a pretty version of mine (with the missed out ";") ;) :P

h1
02-12-2004, 12:58 AM
Yeah, but your script would die if $ref wasn't set.

vivitron 15
02-12-2004, 01:13 AM
lol, k...fair enough :D as i say, didnt think too much about it :)

Ariel_001
02-12-2004, 02:19 AM
<?php
if ($_GET["ref"]) { $ref=$_GET["ref"]; }

print("<meta http-equiv='refresh' content='0; url=$ref'>");

?>

it works perfect. :P Do you any place were i could set this up for free ?

h1
02-12-2004, 06:12 AM
http://www.57host.biz

Ariel_001
02-13-2004, 12:11 AM
Do you guys know how to do this in javascript? It would help me out alot better. :D :P :lol:

h1
02-13-2004, 12:50 AM
Use document.referrer, but this isn't advised.

Ariel_001
02-13-2004, 03:36 AM
Originally posted by haxor41789@13 February 2004 - 00:50
Use document.referrer, but this isn't advised.
Am not exactly sure how to implement this? How would I work this?

h1
02-13-2004, 05:05 AM
Use it like any other JavaScript variable. For example...

<script type="text/javascript">
var ref=document.referrer;
if(ref!=""&&ref!=null)
{
  document.writeln("<meta http-equiv=\"refresh\" content=\"0; url="+ref+"\" />")
}
</script>
This goes in the <head> tag of course. ;)

Ariel_001
02-13-2004, 04:26 PM
test (http://members.lycos.co.uk/directme/redirect.php?ref=http://www.samair.ru/proxy/proxychecker/results.htm)

anyone feel free to use :D :P :lol:

Ariel_001
02-13-2004, 04:33 PM
It seems to work but I need to add some code to remove the ad frame. Do you know me how?

This looks like it could work (http://www.websitemedics.com/frames/jscodes.html) but am not sure how to add it to the php script?

*update*

&#60;script LANGUAGE=&#34;JavaScript&#34;&#62;
&nbsp;if &#40;top &#33;= self&#41; {top.location.href = self.location.href;}
&#60;/SCRIPT&#62;


This also looks like it could work. How would I add it?

h1
02-13-2004, 07:52 PM
That&#39;s illegal, BTW.

Try adding <plaintext> and </plaintext> around the ads script, and in CSS, do...

plaintext
{
&nbsp; display &#58; none;
&nbsp; left &#58; -1000ex;
&nbsp; position &#58; absolute;
&nbsp; top &#58; -1000ex;
}

Ariel_001
02-13-2004, 09:56 PM
Really. I did not know that. I did not think so because it a site outside of members.lycos.co.uk. oh well i guess i can live with it. (the ad)

Ariel_001
02-13-2004, 10:09 PM
Originally posted by haxor41789@13 February 2004 - 19:52
That&#39;s illegal, BTW.

Try adding <plaintext> and </plaintext> around the ads script, and in CSS, do...

plaintext
{
display &#58; none;
left &#58; -1000ex;
position &#58; absolute;
top &#58; -1000ex;
}
I can not edit any of the ad code.
am guesing if i edit


print&#40;&#34;&#60;meta http-equiv=&#39;refresh&#39; content=&#39;0; url=&#036;ref&#39;&#62;&#34;&#41;;

to be like


print&#40;&#34;&#60;meta http-equiv=&#39;refresh&#39; content=&#39;0; url=&#036;ref&#39;&#62;&#34;&#60;script LANGUAGE=&#34;JavaScript&#34;&#62;
if &#40;top &#33;= self&#41; {top.location.href = self.location.href;}
&#60;/SCRIPT&#62;&#41;;

it could work.

Ynhockey
02-13-2004, 11:30 PM
I was just wondering, what&#39;s the reason for you not wanting to show your website as a referrer ?

I mean, I can&#39;t think of any good reason off my head right now... and HTTP Referrers is an important thing for webmasters (to know where their traffic is coming from), for many reasons.

Just wondering.

Btw, I believe your last piece of code would generate a parse error.

Ariel_001
02-14-2004, 02:21 AM
Originally posted by Ynhockey@13 February 2004 - 23:30
I was just wondering, what&#39;s the reason for you not wanting to show your website as a referrer ?

I mean, I can&#39;t think of any good reason off my head right now... and HTTP Referrers is an important thing for webmasters (to know where their traffic is coming from), for many reasons.

Just wondering.

Btw, I believe your last piece of code would generate a parse error.
I want to link to sites that..... may not approve of the subject.


I believe your last piece of code would generate a parse error.

do you know how to make it work. php is not my forte

h1
02-14-2004, 05:46 AM
You&#39;re treating &#036;ref as a string literal without an unescape -- &#036; is a reserved character.

echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;;
echo &#036;ref;
echo &#39;&#34; /&#62;&#39;;

That should do it. :)

Ynhockey
02-14-2004, 02:32 PM
echo "<meta http-equiv=&#39;refresh&#39; content=&#39;0; url=&#39;".&#036;ref."&#39;>&#092;n
&#60;script type=&#092;"text/javascript&#092;">&#092;n
if (top &#33;= self) &#092;{ top.location.href = self.location.href; }&#092;n
</script>";

There&#39;s still a slight chance that it will generate a parse error (didn&#39;t test it), but i think it won&#39;t.

Good luck :)

Ariel_001
02-14-2004, 05:47 PM
&#60;?php
if &#40;&#036;_GET&#91;&#34;ref&#34;&#93;&#41; { &#036;ref=&#036;_GET&#91;&#34;ref&#34;&#93;; }echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;;
echo &#036;ref;
echo &#39;&#34; /&#62;&#39;;

echo &#39;&#60;script language=&#34;javascript&#34;&#62;&#60;&#33;--
if &#40;self.location.href &#33;= top.window.location.href&#41;
{ top.window.location.href = self.location.href }
//--&#62;&#60;/script&#62; &#39;;

?&#62;

This works perfect now. Thanks everybody. :D

Test (http://members.lycos.co.uk/directme/redirect.php?ref=http://www.samair.ru/proxy/proxychecker/results.htm)

Special thanks goes to haxor41789 (http://filesharingtalk.com/index.php?showuser=20637) for the php help. :lol:

Works in both Mozilla and Internet Explorer even with ad muncher running. :rolleyes:

h1
02-14-2004, 06:57 PM
Good job. :)

Ariel_001
02-14-2004, 09:03 PM
&#60;?php
if &#40;&#036;_GET&#91;&#34;ref&#34;&#93;&#41; { &#036;ref=&#036;_GET&#91;&#34;ref&#34;&#93;; }echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;;
echo &#036;ref;
echo &#39;&#34; /&#62;&#39;;

echo &#39;&#60;script language=&#34;javascript&#34;&#62;&#60;&#33;--
if &#40;self.location.href &#33;= top.window.location.href&#41;
{ top.window.location.href = self.location.href }
//--&#62;&#60;/script&#62; &#39;;

echo &#39;&#60;br&#62;&#39;;
echo &#39;&#60;a href=&#34;&#39;;
echo &#036;ref;
echo &#39;&#34;&#62;&#39;;
echo &#036;ref;
echo &#39;&#60;/a&#62;&#39;;

?&#62;

I decided to add an link too. I find it kind of cumbersome to use a bunch of echo(s).

h1
02-14-2004, 09:13 PM
Then make it one echo. :)

&#60;?php
if isset&#40;&#40;&#036;_GET&#91;ref&#93;&#41;&#41;
{
&nbsp; &#036;ref = &#036;_GET&#91;&#34;ref&#34;&#93;;
&nbsp; echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;.&#036;ref.&#39;&#34; /&#62;&#39;;
&nbsp; echo &#39;&#60;script language=&#34;javascript&#34;&#62;if &#40;self.location.href &#33;= top.window.location.href&#41; { top.window.location.href = self.location.href }&#60;/script&#62;&#60;br&#62;&#60;a href=&#34;.&#036;ref.&#34;&#62;&#39;.&#036;ref.&#39;&#60;/a&#62;&#39;;
}
else
{
&nbsp; alert&#40;&#34;No link specified.&#34;&#41;;
&nbsp; history.go&#40;-1&#41;;
}
?&#62;

Ariel_001
02-15-2004, 08:45 PM
Parse error: parse error, unexpected T_ISSET, expecting &#39;(&#39; in redirect.php on line 2

It looks very good but am getting this error.

h1
02-15-2004, 08:58 PM
Shit...

&#60;?php
echo &#39;&#60;&#39;.&#39;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;yes&#34; ?&#39;.&#39;&#62;&#092;n&#60;&#33;doctype html public &#34;-//W3C//DTD XHTML 1.1&#34; &#34;http&#58;//www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34; /&#62;&#092;n&#60;html xmlns=&#34;http&#58;//www.w3.org/1999/xhtml&#34; xml&#58;lang=&#34;en-US&#34; lang=&#34;en-US&#34; dir=&#34;ltr&#34;&#62;&#092;n&#60;head&#62;&#092;n&#39;;
if &#40;isset&#40;&#036;_GET&#91;ref&#93;&#41;&#41;
{
&nbsp;&#036;ref = &#036;_GET&#91;&#34;ref&#34;&#93;;
&nbsp;echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;.&#036;ref.&#39;&#34; /&#62;&#092;n&#60;script language=&#34;javascript&#34;&#62;if &#40;self.location.href &#33;= top.window.location.href&#41; { top.window.location.href = self.location.href }&#60;/script&#62;&#60;br&#62;&#60;a href=&#34;.&#036;ref.&#34;&#62;&#39;.&#036;ref.&#39;&#60;/a&#62;&#39;;
}
else
{
&nbsp;alert&#40;&#34;No link specified.&#34;&#41;;
&nbsp;history.go&#40;-1&#41;;
}
?&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;/body&#62;
&#60;/html&#62;

That should do it. :)

Ariel_001
02-15-2004, 09:06 PM
&#092;n&#092;n&#092;n&#092;n
Fatal error: Call to undefined function: alert() in redirect.php on line 10

Now it says that. is a &#092;n a line break ? i removed all the &#092;n and i get


Fatal error: Call to undefined function: alert() in redirect.php on line 10


Do i have to use a bunch of echo(s) of something ?

h1
02-16-2004, 01:49 AM
Damn... forgot to echo the last few lines...
[code]<?php
echo &#39;<&#39;.&#39;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&#39;.&#39;>&#092;n<&#33;doctype html public "-//W3C//DTD XHTML 1.1" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />&#092;n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">&#092;n<head>&#092;n&#39;;
if (isset(&#036;_GET[ref]))
{
&#036;ref = &#036;_GET["ref"];
echo &#39;<meta http-equiv="refresh" content="0; url=&#39;.&#036;ref.&#39;" />&#092;n&#60;script language="javascript">if (self.location.href &#33;= top.window.location.href) { top.window.location.href = self.location.href }</script>
&#39;.&#036;ref.&#39; (.&#036;ref.)&#092;n&#39;;
}
else
{
echo &#39;alert("No link specified.");&#092;nhistory.go(-1);&#092;n&#39;;
}
?>
</script>
</head>
<body>
</body>
</html>

Ariel_001
02-16-2004, 08:41 PM
&#60;?php
echo &#39;&#60;&#39;.&#39;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;yes&#34; ?&#39;.&#39;&#62;&#60;&#33;doctype html public &#34;-//W3C//DTD XHTML 1.1&#34; &#34;http&#58;//www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34; /&#62;&#60;html xmlns=&#34;http&#58;//www.w3.org/1999/xhtml&#34; xml&#58;lang=&#34;en-US&#34; lang=&#34;en-US&#34; dir=&#34;ltr&#34;&#62;&#60;head&#62;&#39;;
if &#40;isset&#40;&#036;_GET&#91;ref&#93;&#41;&#41;
{
&#036;ref = &#036;_GET&#91;&#34;ref&#34;&#93;;
echo &#39;&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=&#39;.&#036;ref.&#39;&#34; /&#62;&#60;script language=&#34;javascript&#34;&#62;if &#40;self.location.href &#33;= top.window.location.href&#41; { top.window.location.href = self.location.href }&#60;/script&#62;&#60;br&#62;&#60;br&#62;&#60;br&#62;&#60;br&#62;&#60;a href=&#34;.&#036;ref.&#34;&#62;&#39;.&#036;ref.&#39;&#60;/a&#62;&#39;;
}
else
{
echo &#39;&#60;br&#62;&#60;br&#62;&#60;br&#62;&#60;br&#62;No link specified.&#39;;
}
?&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;/body&#62;
&#60;/html&#62;


Your javascript alert does not seem to work. So it now just a text message. It seems to work better now. Does not reload in a infinite loop. Thanks alot haxor41789 (http://filesharingtalk.com/index.php?showuser=20637). I really appreciate it. B) :P :D :lol:

Test (http://members.lycos.co.uk/directme/redirect.php?ref=http://www.samair.ru/proxy/proxychecker/results.htm)

Test 2 (http://members.lycos.co.uk/directme/redirect.php)

Arm
02-17-2004, 01:50 AM
You can get the proxy ad-blcoking program The Proxomitron (http://www.proxomitron.info/). It has an option to block referrer info.

Ariel_001
02-17-2004, 02:26 AM
Originally posted by Arm@17 February 2004 - 01:50
You can get the proxy ad-blcoking program The Proxomitron (http://www.proxomitron.info/). It has an option to block referrer info.
How is that going to help me?

Arm
02-17-2004, 06:14 AM
Originally posted by Ariel_001+16 February 2004 - 21:26--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (Ariel_001 @ 16 February 2004 - 21:26)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-Arm@17 February 2004 - 01:50
You can get the proxy ad-blcoking program The Proxomitron (http://www.proxomitron.info/). It has an option to block referrer info.
How is that going to help me? [/b][/quote]
:huh: It will fake your referrer and make the referrer always be the current site you are on. :)

Ariel_001
02-17-2004, 08:04 PM
How it will help me as a web master. I want to make links to some sites but do not want the sites to (easily) be able to trace links back to me