SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Whats happenin

  1. #1
    SitePoint Guru godsfshrmn's Avatar
    Join Date
    Mar 2001
    Posts
    671
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Whats happenin

    What does this script do? I have no JS knowdlege at all, only PHP, so please be kinda vague .
    <script language="javascript">
    var data, p;
    var agt=navigator.userAgent.toLowerCase();
    var img=escape("./buttons/b1.jpg");
    document.cookie='__support_check=1';
    p='http';
    if((location.href.substr(0,6)=='https:')||(location.href.substr(0,6)=='HTTPS:')) {p='https';} data = '&agt=' + escape(agt) + '&img=' + img + '&r=' + escape(document.referrer) + '&aN=' + escape(navigator.appName) + '&lg=' + escape(navigator.systemLanguage) + '&OS=' + escape(navigator.platform) + '&aV=' + escape(navigator.appVersion);
    if(navigator.appVersion.substring(0,1)>'3') {data = data + '&cd=' + screen.colorDepth + '&p=' + escape(screen.width+ 'x'+screen.height) + '&je=' + navigator.javaEnabled();};
    document.write('<a href="http://servustats.com/template.php?a=valcoweb">');
    document.write('<img border=0 hspace=0 '+'vspace=0 src="http://servustats.com/counter.php?a=valcoweb' + data + '"> </a>');
    </script>
    s c r i p t s f o r y o u . n e t
    ScriptsForYou

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if you want me to walk you through but essentially you are grabbing a button from another server. Looks like a statitcs server by the look of things.

    first it figures out if you are an http or https

    It is sending all of the information about the user such as the browser, platform, language and also the information about the referer (the web sites with the button)

    It then checks to see if version number 3 or up for any browser and then sends screen height, width, colour depth and if it java enabled.

    it then takes all of this information and sends it to a php base server stat couter.

    Hope that helps ...(that code was damn ugly looking too)
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Enthusiast RogueJedi's Avatar
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On my system here at work, using IE 5.5sp2 it produces the following code:
    Code:
    <A href="http://servustats.com/template.php?a=valcoweb"><IMG hspace=0 
    src="http://servustats.com/counter.php?a=valcoweb&amp;agt=mozilla/4.0%20%28compatible%3B%20msie%205.5%3B%20windows%20nt%205.0%3B%20netcaptor%206.5.0%29&amp;img=./buttons/b1.jpg&amp;r=&amp;aN=Microsoft%20Internet%20Explorer&amp;lg=en-us&amp;OS=Win32&amp;aV=4.0%20%28compatible%3B%20MSIE%205.5%3B%20Windows%20NT%205.0%3B%20NetCaptor%206.5.0%29&amp;cd=16&amp;p=1280x1024&amp;je=true" 
    border=0> </A>
    What the script is doing is building the querystring portion of a URL for the image source, so that a particular image is shown depending on if you are running a browser version higher than 3. This appears to be for some sort of stats tracking. The querystring details what website you just came from, your browser name and version, your OS and language (locale), your screen resolution and color depth, and if Java is enabled or not.
    Rob Nolan
    Do or do not, there is no try.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •