# Counterrrrrrr (roll your r's)

**URL:** <https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796>\
**Category:** Uncategorized\
**Created:** [February 4, 2003, 9:55pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796 "2003-02-04T21:55:24Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 8:33pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/21 "2003-02-06T20:33:05Z")

</div>

so basically i wanna know if anyone thinks this is doable or should i just scrap it and randomly think of some other semi-cool thing to do

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 9:48pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/22 "2003-02-06T21:48:17Z")

</div>

It is up to you whether you want to scrap it or press on.

I found this CGI Roman Numeral Hit Counter

[http://www.xav.com/scripts/roman/](http://www.xav.com/scripts/roman/)

Perhaps you can try loading the variable from the cgi file (with loadVars) and displaying it in flash instead of having it type it on the page.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:10pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/23 "2003-02-06T22:10:33Z")

</div>

first off, it doesnt have to be in flash… that was just a thought  
secondly, i have absolutely no coding knowledge except for basic html… so if you guys think its too hard for a complete n00b(i didnt just say n00b) do you think you could point out some stuff… or better yet, how about i just try it and then tell you where im stuck… derrrr

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:14pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/24 "2003-02-06T22:14:18Z")

</div>

wow… this is how far i got… i d/led the zip file… then i looked at it (contains an empty folder called data, roman.pl and a help site link)  
ok i dont even know what .pl is so umm help?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:16pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/25 "2003-02-06T22:16:56Z")

</div>

Well in the link I sent on the same page there is a part that says…

\<B\>Installation and Configuration\</B\>

That should tell you how what you have to do.

As for doing it in Flash… for a complete n00b I am not sure, because I didn’t try getting it to work in Flash so I don’t know if it is as easy as just pulling a loadVars on the cgi file.

Oh, and .pl is a Perl file.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:18pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/26 "2003-02-06T22:18:07Z")

</div>

ok well im just gonna attempt to do what it says on the site  
thanks for all the help lost  
i really appreciate it

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:18pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/27 "2003-02-06T22:18:32Z")

</div>

No problem, I hope you get it working.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:19pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/28 "2003-02-06T22:19:43Z")

</div>

i read what it said… its like a foreign language to me… it says to set the variables… whats that about? and once i get this all up and running how do i actually put it on my page and wow i am so lost (no pun intended)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:22pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/29 "2003-02-06T22:22:26Z")

</div>

ok i get some parts now, i put it on the page by useing the execute cgi tag right? but i still dont get what im supposed to edit in the code

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:23pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/30 "2003-02-06T22:23:40Z")

</div>

#!/usr/bin/perl –  
use strict;

# Roman Numeral Counter, Version 1.0.0.0003

# Copyright 1997-2001 by Zoltan Milosevic. Please adhere

# to the copyright notice and conditions of use which are described

# in the attached help file and hosted at the URL below.

# 

# For latest version and help files, visit:

# [http://www.xav.com/scripts/roman/](http://www.xav.com/scripts/roman/)

# \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

# Instructions:

# -------------

# Below, in the $directory variable, write in the path to a writable

# directory on your system:

my $directory = ‘data’;

# Make this directory writable by typing “chmod 777 data”.

# 

# Include the following in your web pages:

# 

# \<B\>You are visitor number \<!–#exec cgi=“roman.pl” --\>.\</B\>

# 

# \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

print “Content-Type: text/html\015\012\015\012”;  
my $err = ‘’;  
Err: {  
unless (chdir($directory)) {  
$err = “unable to chdir to $directory folder ‘$directory’ - $!”;  
next Err;  
}  
unless ($ENV{‘DOCUMENT\_URI’}) {  
$err = “environment variable DOCUMENT\_URI is not defined (script must be called as SSI)”;  
next Err;  
}  
my $Document = $ENV{‘DOCUMENT\_URI’};  
$Document =~ s///\_/g;  
my $Hits = 0;  
if (-e $Document) {  
unless (open(COUNT,"\<$Document")) {  
$err = “unable to read file ‘$Document’ - $!”;  
next Err;  
}  
$Hits = \<COUNT\>;  
close(COUNT);  
}  
$Hits++;  
unless (open(COUNT,"\>$Document")) {  
$err = “unable to open file ‘$Document’ for writing - $!”;  
next Err;  
}  
print COUNT $Hits;  
close(COUNT);  
my ($Ones,$Tens,$Hundreds) = split(//, reverse $Hits);  
print ‘M’ x int($Hits/1000);  
print ((’’,‘C’,‘CC’,‘CCC’,‘CD’,‘D’,‘DC’,‘DCC’,‘DCCC’,‘CM’)[$Hundreds]);  
print ((’’,‘X’,‘XX’,‘XXX’,‘XL’,‘L’,‘LX’,‘LXX’,‘LXXX’,‘XC’)[$Tens]);  
print ((’’,‘I’,‘II’,‘III’,‘IV’,‘V’,‘VI’,‘VII’,‘VIII’,‘IX’)[$Ones]);  
last Err;  
}  
continue {  
print "\<P\>\<B\>Roman TextCounter Error:\</B\> $err.\</P\>  
";  
}

theres the code

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:25pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/31 "2003-02-06T22:25:19Z")

</div>

Make this directory writable by typing “chmod 777 data”.

thats the part i dont get  
where do i type that? is that like another file or what?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:26pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/32 "2003-02-06T22:26:09Z")

</div>

To edit the variables you must open the .pl file in a regular text editor or in dreamweaver or some other HTML editor.

The chomodding. Now that is one thing I had trouble with starting out on the web. CHMOD is setting the permission of your file. Your server MUST support this option. Usually if you access your files through FTP, chmodding is allowed (but not all the time). If you use a free host (tripod, geocities, etc) you most likely will not be allowed to do this, so the script won’t work ☹

But if you use an FTP program to access your site, there should be an option in there that allows you to chmod your files on your server. If not, you will have to contact your host and find out how.

If your server does not support chmodding of files, then you will not be able to have a counter, a counter requires the opening and writing to another file to save the information.

And the #exec cgi=“roman.pl” part they talk about, that includes the cgi file on your HTML page you want it displayed on.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:29pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/33 "2003-02-06T22:29:08Z")

</div>

ok well im using [iwarp.com](http://iwarp.com) which is a sub-thinger of [freeservers.com](http://freeservers.com) and i just use the manage files utility, so i have no idea how to use ftp… i think it supports ftp… it has cute\_ftp and some other thing on there… so should is there like a free ftp thing i could get?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:30pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/34 "2003-02-06T22:30:55Z")

</div>

Well if they have a User Control Panel there, they most likely would have the CHMOD ability somehwere in there.

Maybe check their help files and see what you can find on it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:35pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/35 "2003-02-06T22:35:58Z")

</div>

i cant find a search box anywhere on the site… and i looked pretty much everywhere and there wasnt mention of CHMOD… so im not entirely sure what to do… im guessing you dont have any knowledge of the [freeservers.com](http://freeservers.com) stuff do you? maybe i could tell you my account and password or something and you could dig around in there? i dunno what to do

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:41pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/36 "2003-02-06T22:41:32Z")

</div>

Hmm, wow… Freeservers help files only gives you a few things if you are not logged it.

It says to view more you must log in then view this page…

[http://help.freeservers.com/cgi-bin/help/](http://help.freeservers.com/cgi-bin/help/)

Im not going to root through those links for you man, besides, I gotta go now.

Later, and good luck!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2003, 10:42pm UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/37 "2003-02-06T22:42:51Z")

</div>

thanks for all your help lost… by the time you get there should be a million more questions for you… thanks again

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2003, 12:47am UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/38 "2003-02-07T00:47:49Z")

</div>

Let’s see here… Actually… let’s stand back and actually think about how Roman Numerals are set up before we move to bigger things…

1 - 5 : I, II, III, IV, V  
5-10 : V, VI, VII, VIII, IX, X

Okay… So you see this much… Then Let’s say we want to do 10,20,30,40 then 50…

X, XX, XXX, XL, L

That’s assuming if the L is actually correct… Well then… This is easy to figure out… 50,60,70,80,90,100 would be…

L, LX, LXX, LXXX, XC, C

It has a pattern… A basic pattern that will be settled throughout this whole thing… So we can set up a bunch of functions in flash to handle each setting… Depending on how high you wnat to go… I’ll make this easier on me by saying 9,999 hits.

First… let’s handle all the arryays you will need to complete this…

1to10 = ("",“I”,“II”,“III”,“IV”,“V”,“VI”,“VII”,“VIII”,“IX”,“X”);  
10to100 = ("",“X”,“XX”,“XXX”,“XL”,“L”,“LX”,“LXX”,“LXXX”,“XC”,“C”);  
100to1000 = ("",“C”,“CC”,“CCC”,“CD”,“D”,“DC”,“DCC”,“DCCC”,“CM”,“M”);  
1000to10000 =  
("",“M”,“MM”,“MMM”,“MV”,“V”,“VM”,“VMM”,“VMMM”,“MX”,“X”);

Since we are only going up to 9,999 or in RN state :  
MXCMXCIX

::: Marz Roman Numeral Lesson :::  
Let’s see here… You see the V as 5000? That’s actually suppose to have a bar over the number… But I can’t really show you that using the tools I have here… Soo… Just think that I know what I’m talking about _lmao_  
::: End Marz RN Lesson :::

Now… Back to the Flash Tutorial Lesson… Woooohooooo…

Let’s make a hugely main Roman Numeral Number Converter…

```php

intToRN(intNum, yourTextBox)
{
   strNum = new String();
   strNum.concat(intNum);
   storedNums = new Array();
   storedNums = strNum.split("");
   placesLeft = storedNums.length;
   
   // This makes a string.. Places the hitNum in the string
   // then it splits the big number 9999 for instance.. 
   // into "9","9","9","9".... That way we can see how it
   // is really handled.. placesLeft is a variable that tells 
   // how many places are in the number... 867 = 3, 24 = 2

   finalRN = new Array();
   x = 0;

   // finalRN will hold the actual RN's used in this
   // and x is just sitting there.. being able to be used..
   // just like the little slut letter it is.

   if(placesLeft == 4)
   {
      finalRN[x] = 1000to10000[storedNums[x]];
      x++;
   }
   if(placesLeft == 3)
   {
      finalRN[x] = 100to1000[storedNums[x]];
      x++;
   }
   if(placesLeft == 2)
   {
      finalRN[x] = 10to100[storedNums[x]];
      x++;
   }
   if(placesLeft == 1)
   {
      finalRN[x] = 1to10[storedNums[x]];
      x++;
   }

   // Basically says.. Well If there are this many places
   // left in this thing.. Then convert this portion to
   // the correct Roman Numeral

   strNum = finalRN.join("");

   yourTextBox = strNum;

   //Put the thing back into a string.. and display it
}

```

Wow… Basically to just clal this… Say…

intToRN(9678, counterText);

It’ll take 9678… Make it MXDCLXXVIII and place that into the dynamic text box known as counterText…

Wow… This was a bit harder than I thought… But doesn’t it make sense when you split it apart? hehe…

Well Hope this works for you… Have Fun!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2003, 12:51am UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/39 "2003-02-07T00:51:09Z")

</div>

Wow man… great script.

Couldn’t test it, but I am sure you wouldn’t post it if it didn’t work :crazy:

I couldn’t do much with mine because I am horrible with Roman Numerals. Numbers and Math of any kind hates me, and I hate it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2003, 1:09am UTC](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796/40 "2003-02-07T01:09:33Z")

</div>

wow, took me a min to notice that… so do you want to tell me what exactly to do with that script… i know how to make a dynamic text box but thats about it… and i dont i need a cgi file or something like that to store the data in… idk im new to this… but if i need the cgi im gonna have to wait until i purchuse [xxviii.net](http://xxviii.net) in a couple months…

[Previous page](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796.md?page=1)

[Next page](https://forum.kirupa.com/t/counterrrrrrr-roll-your-rs/12796.md?page=3)
