|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
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/testfirstl...cond/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
|
|||
|
|||
|
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 ? |
|
#3
|
|||
|
|||
|
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... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > help with script... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|