Link to home
Start Free TrialLog in
Avatar of athan
athan

asked on

Counter?

  I have a homepage which I want to add a counter on how many person visited the said page.  What I didn't understand is how do I create my homepage...

Will it be on perl so that it automatically display my homepage with counter itself.

Or will i write it on html and call a cgi.

  Im still learning perl and as i follow some sample perl script I've noticed that when they call a cgi then the return result is displayed in another window.  But I want my counter to be in the same window with my homepage. Can u help me? Pls.... :D
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of athan
athan

ASKER

thanks viktornet... Yes the counter's work but how can i apply the cgi.  Do I really have to create my homepage in perl or just plane html?
your CGI should create the page... so you can simply read your HTML file, then add the counter thingy, and then create your new page, and display it...

..-=ViKtOr=-..
Avatar of athan

ASKER

thanks viktornet... Yes the counter's work but how can i apply the cgi.  Do I really have to create my homepage in perl or just plane html?
Avatar of athan

ASKER

can u give me a sample by creating a page on cgi and read the html file as it will create a new page.  A simple one will do... thanks
here is an example that would open any file..

open(file, "nameoffile.ext");
$text = <file>;
close(file);
print $text;

This will print whatever is in nameoffile.ext

This is just Perl, actually, not implemented for use with CGI, and stuff.... you need a few more things in order to do that.. probbaly would have to read environment settings and stuff...

Good Luck!!

..-=ViKtOr=-..
Avatar of athan

ASKER

thank you
athan, hello again!!

I created a counter a few days ago, if you'd like to take a look at it, please let me know. I will tell you what I did step by step to get it to work... it is at http://delphisite.hypermart.net

..-=ViKtOr=-..