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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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=-..
..-=ViKtOr=-..
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?
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=-..
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=-..
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=-..
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=-..
ASKER