#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    18
    Rep Power
    0
    i put a script together... the only problem is it works great, and writes a new file for all webpages AS LONG AS THEY ARE IN THE FIRST SUBDOMAIN... i.e. http://www.kidz4dayz.com/counter.html

    i need to be able to use the counter "deeper" in the subdomains... i.e. http://www.kidz4dayz.com/testfirstle...ond/test.shtml

    but all i get is repeating #1... what can i do to this script to get it to work the way that i want...?

    #!/usr/local/bin/perl


    $pagepath = $ENV{'DOCUMENT_URI'};

    $counter_file = "counter/$pagepath";

    print "Content-type: text/htmlnn";

    open(FILE, ">>$counter_file");
    close(FILE);

    open(FILE, "$counter_file");
    @indata = <FILE>;
    close(FILE);

    $onoff = 0;
    open(FILE, ">$counter_file");
    foreach $temp (@indata)
    {
    chop($temp);
    ($uri, $count) = split(/|/, $temp);
    if ($uri eq $pagepath) {
    $count++;
    $onoff = 1;
    print FILE "$uri|$countn";
    print "$count"; }
    else { print FILE "$uri|$countn"; }
    }
    if ($onoff eq 0) {
    print FILE "$pagepath|1n";
    print "1"; }

    close(FILE);


    thanks so much...




    [This message has been edited by tucats (edited January 25, 2000).]
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    cph,,denmark
    Posts
    2
    Rep Power
    0
    Taking a quick glance at your script, I wonder why you do

    $counter_file = "counter/$pagepath";

    instead of

    $counter_file = "$pagepath/counter";

    or am I just missing the point ?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    18
    Rep Power
    0
    rindal...

    i thank you for your follow up...

    i have dumped that script and have put together a new script that does everything that i want it to do...

    thanks again...

IMN logo majestic logo threadwatch logo seochat tools logo