New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Counter of sorts


Post Reply New Thread Subscribe

 
Thread Tools
Graphite

 
Graphite's Avatar
 
Member Since: Feb 25, 2003
Location: Tropical Island, Jealous?
Posts: 5,279
Graphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud of
Mac Specs: MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display

Graphite is offline
im not exactly an expert html coder, I only bothered learning enough to build a quality site.

I am now wondering about a counter, I hate seeing counters on pages... but it may be the only way I can get an accurate # of visits to mysite.

Anyone have a better way? Ide hate to clutter my site with a visible counter.
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
You can make a relatively easy invisible one with php. Do you know any php? I can't remember the code off the top of my head but I'll try find a tutorial for you.

I'm in your forums, writing sentences in a grammatically acceptable manner.
QUOTE Thanks
Graphite

 
Graphite's Avatar
 
Member Since: Feb 25, 2003
Location: Tropical Island, Jealous?
Posts: 5,279
Graphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud of
Mac Specs: MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display

Graphite is offline
ok thnx man. invisible would be best, cus I can't stand clutter
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
here you go: PHP hit counter

Just the basic outline so you can understand what the code means;
  • Anything with a $ in front of it is a variable, it is either being assigned or being displayed
  • Page 2 is optional, leave it out if you want an invisible counter, just make sure you add the very first line of it to the page you want counted (the <?php include... ?> one) at the top of your document.
  • The stuff between the <? and ?> is the php code, and can be put inside another document or linked to as a separate one.
  • To use php scripts in a html document (not as a standalone one), the eaisest way is to rename your file from .html to .php

What the script does: The file countFunction.php is a file that is separate from everything else and linked to from your index.php page (make sure your page is index.php not index.html). When the browser loads the page it also loads and executes that file. The php code asks the browser if the user has been counted already (in the current session) and if not, writes to the file counter.txt the new number of visitors.

Something I find really useful but is completely unrelated: If you have a site where the same thing appears on each page but changes often (i.e. a news bar on the side or something you want to spotlight), put the corresponding code with all the html tags into a file, yourfilenamehere.txt. Take it out of the original page, and put this line of code into where you want the information displayed: <?php include "yourfilenamehere.txt"; ?>. Change index.html or whatever page it is to index.php and you're away. If you change the text file it will change the html file. So you can add this piece of code to any page you want and it will always display the same.

[edit]Oops, for the function to be called that does all the work, you will need to have the line <?php Counter(); ?> in there somewhere... but this will display the number of hits. Edit the last line "echo $finalcount" out of countFunction.php.

I'm in your forums, writing sentences in a grammatically acceptable manner.
QUOTE Thanks
Emrys

 
Emrys's Avatar
 
Member Since: Oct 27, 2002
Location: Vermont
Posts: 1,345
Emrys is on a distinguished road
Mac Specs: 17" iMac G4 800MHz 1GB RAM

Emrys is offline
Who is your host? You should be able to access web server statisctics.....

Emrys
Community Administrator / Moderator
MAC-FORUMS.COM - The Ultimate Source For Your Mac!
QUOTE Thanks
Graphite

 
Graphite's Avatar
 
Member Since: Feb 25, 2003
Location: Tropical Island, Jealous?
Posts: 5,279
Graphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud of
Mac Specs: MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display

Graphite is offline
Thnx muso big help (Ill end up messin up some lil thing so I know ill be back )

Emrys, my host is my school... they weren't to clear on what we could have on our sites... ie software company site.. but I don't wana pester them in the case Im not suppose to have that that and im pretty sure the tech support here knows less then me (AND IVE NEVER SEEN THE SERVER).
QUOTE Thanks
Graphite

 
Graphite's Avatar
 
Member Since: Feb 25, 2003
Location: Tropical Island, Jealous?
Posts: 5,279
Graphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud ofGraphite has much to be proud of
Mac Specs: MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display

Graphite is offline
Yeah, Im messing something up. Ive got class in 10 so perhaps im just in a rush.
QUOTE Thanks

Post Reply New Thread Subscribe


« Web Design with a Mac | Disable Header printing in NN7 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Hit Counter dziner Web Design and Hosting 8 08-23-2004 11:13 PM
invisible cookie page counter design2 Web Design and Hosting 1 05-17-2004 06:07 PM

All times are GMT -4. The time now is 09:14 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?