The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. July 22, 2019, 10:42:54 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: How to capture the current url and transfer it to another domain.  (Read 2912 times)
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« on: June 30, 2013, 06:27:16 PM »

I always come here when no one else can answer the question.. cause you guys are the best.
So here we go:
I am trying to get the current URL of the current loaded page to another domain sorta like the stat counters do, but I only need the document.URL at this time..below is some of the tons of things i have tried but none have worked so far.

Code:
<script>
dog = document.URL;
</script>

<img src="hxxp://mytracker.com/cgi-bin/cgi-bin/keff_head.pl?idx=" & dog>

<img src="hxxp://mytracker.com/cgi-bin/cgi-bin/keff_head.pl?idx=" & document.URL>



if I add something after the = such as idx=234abc then it goes thru to the other domain just fine... but I cannot figure out how to transfer the current url and attach it to the url.  Stat counters do it all the time so it must be possible... but cannot figure it out for the life of me...
IF anyone knows anyway to tag the Current URL to the img url I will forever be in your debt.


Here is what its looking like on the PERL end.. shows the IP and user agent... but no url which is the most important.

Code:
IDX(*6/30*) - (*20:27:39*)|72.218.222.78|http://idx.mydomain.com/idx/widgetpreview.php?widgetid=47168|/cgi-bin/keff_head.pl|Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0|IDX=

IDX(*6/30*) - (*20:27:7*)|72.218.222.78|http://idx.mydomain.com/idx/widgetpreview.php?widgetid=47168|/cgi-bin/keff_head.pl|Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0|IDX=

Thanks for any suggestions.

« Last Edit: June 30, 2013, 06:34:51 PM by tommytx » Logged
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #1 on: July 01, 2013, 12:23:03 AM »


Hi Tommy,

I'm not good with JS, but I got something working, others can add the polish.

Code:
<script>
  var theURL = ('http://www.google.com?idx=' + document.URL);
  var imageURL = ('<img src=' + theURL + '>' );

  document.write(theURL + '<P>\n\n');
  document.write(imageURL);
</script>


This is the generated source

Code:
<html><head><script>
var theURL = ('http://www.google.com?idx=' + document.URL);
var imageURL = ('<img src=' + theURL + '>' );

document.write(theURL + '<P>\n\n');

document.write(imageURL);

</script></head><body>http://www.google.com?idx=file:///C:/docURL.html<p>

<img src="http://www.google.com?idx=file:///C:/docURL.html">


</p></body></html>

file:///C:/docURL.html is just the test file where I dabbled.


The first line of my script is where you were having your problem, I think:
 var theURL = ('http://www.google.com?idx=' + document.URL);


good luck,
Bomps




« Last Edit: July 01, 2013, 12:25:21 AM by Bompa » Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #2 on: July 01, 2013, 11:26:24 AM »

As usual Bompus... you are a genius... as I know I can always get valuable information here.
You know actually using PERL i would normally be receiving the URL via the Perl Referrer and I did when it would activate...
However they have a 1.5 hour cache on the site.. so the image was not being called for and it would not light off except each 1.5 hours.
The javascript forces the page to respond on every load.. not just each load every 1.5 hours... not sure why.. but it rarely lit off the referrer and its because of the long cache...

Now I Know its impossible but you have done miracles before... the IP of the human visitor is transferred automatically to me, however as we know google will not trip the javascript so I can never see his IP.... is that true.. there just flat ain't no way to see googles IP via javascript... and of couse I cannot use php on the site... but at least most of what I need is working.... thanks again....

A Bompus quote:
Whenever I point my finger, I have three pointing back at me.

Unless you got athritis and then all 5 are point away from you since you cant' bend them anyway..

« Last Edit: July 01, 2013, 11:28:59 AM by tommytx » Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #3 on: July 01, 2013, 11:41:36 AM »

A last minute thought... the document.write command is printing the entire url and the referrer on the bottom of the page.  Is there anyway to point that to a Null... or is the only way to stop that to make the text and the background the same color... not a biggie.. guess I will do the background and text same color unless someone has a better idea.

This is all I am using to make it work...
Code:
<script>
  var theURL = ('http://www.mydomain.com/cgi-bin/tom.pl?idx=' + document.URL);
  var imageURL = ('<img src=' + theURL + '>' );
  document.write(theURL + '<P>\n\n');
  document.write(imageURL);
</script>
« Last Edit: July 01, 2013, 11:45:18 AM by tommytx » Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: July 01, 2013, 11:48:56 AM »

I've only got a moment so I didn't read this thread fully, but if I gather what you're trying to do then I think this should "pull a graphic" but actually tell you where it came from...

<script>
temp = new Image();
temp.src = 'http://mydomain.com/graphics/tracker.gif?url=' + document.URL;
</script>

Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #5 on: July 01, 2013, 12:02:10 PM »

Thanks for that Perk... but I don't fully understand how to use that... looks good but not sure how to use...  What Bompus gave was absolutely perfect and as a final comment i just wondered if there was an easy way to prevent the url from printing on the page.  Just makes an eyesore. .but the project is otherwise perfect and I can use it as it is... by making the text and background the same color.

So he solved this thread with a perfectly usable item...

I will try to play with what you did to see if I can figure it out... always interested in other ways to skin a cat...

Just to clarify... I am using the image on their page to be able to grab the ip, agent and url of page ... so if they display the image I get that data.
sorta like the emails.. that say images stopped to prevent giving away your identity...
So I could care less about the image... just that it displays on thier page so  I can get the data...

Thanks

Logged
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #6 on: July 01, 2013, 03:34:08 PM »

The code document.write(theURL + '<P>\n\n'); is there ONLY to show us that it works.

Just precede that line with two // to comment it out.
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #7 on: July 01, 2013, 08:22:23 PM »

Thanks that worked fine... you can close this thread.. since i am sure we will never solve the get google IP part of it...
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!