Javascript: How is data being retrieved here.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
EricS
Forum Contributor
Posts: 183
Joined: Thu Jul 11, 2002 12:02 am
Location: Atlanta, Ga

Javascript: How is data being retrieved here.

Post by EricS »

Below is a script that I add to my pages to do visitor tracking. Some how this script is relaying information to another server where that information is processed and inserted into a database. I'm not the best javascript person, but this appears to construct an image link with a query string attached to it. My question is how are they retrieving that query string on the other side? (I'm sorry if this belongs in server side forum)

Code: Select all

<script language="javascript"><!--
an=navigator.appName;d=document;function
pr()&#123;d.write("<img src="http://v0.extreme-dm.com",
"/0.gif?tag=index&j=y&srw="+srw+"&srb="+srb+"&",
"rs="+r+"&l="+escape(d.referrer)+"" height=1 ",
"width=1>");&#125;srb="na";srw="na";//-->
</script>
              <script language="javascript1.2"><!--
s=screen;srw=s.width;an!="Netscape"?
srb=s.colorDepth:srb=s.pixelDepth;//-->
</script>
              <script language="javascript"><!--
r=41;d.images?r=d.im.width:z=0;pr();//-->
</script>
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

Once the link is submitted to the other site, they can access it via the URL query string (in PHP, this is done with the $_GET['var'] superglobal). There are any number of ways to get data from a URL, and thus there is no real way to know what method the other website uses.
EricS
Forum Contributor
Posts: 183
Joined: Thu Jul 11, 2002 12:02 am
Location: Atlanta, Ga

It's calling a gif

Post by EricS »

I understand how to get a query string when you are requesting a server-side page, but this appears to be getting a .gif (an image). How are they parsing the query string when it's calling an image, 0.gif to be exact, and not a server document like "process.php" for example.

What I'm wanting is to be able to imbed a javascript code into an static html page (not server-side scripting page) that can pass information to a php page that will process the input into a database. I know all the mechanics of processing input and database manipulation. It's how I can pass the information from a static, straight, html and javascript page to a php page without making the visitor access that php page directly.

The above script is passing information about the visitor to another web server, and it's doing it with an image tag. I just can figure out how they are processing the information on the other side when the request is for a gif.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the source for an image-element is a request like any other, too.
What is processed in which way you cannot determine from the client side. If I like it to my apache treats *.tmp.bak files as php ;)
e.g. http://httpd.apache.org/docs/mod/mod_mi ... #forcetype
Post Reply