PHP questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaymoore_299
Forum Contributor
Posts: 128
Joined: Wed May 11, 2005 6:40 pm
Contact:

PHP questions

Post by jaymoore_299 »

I am new to php programming.

I have many referrers that I need to keep track of in order to manage my out traffic accordingly. In order to do this, I need to know the domains the surfers are coming from. What is the best way to do this? I heard that HTTP_REFERER is browser optional so this information may not be sent. Should I request my referrers use a url like http://www..com/?id=342233 or use sessions? I want to have something that works whether the surfer has javascript, cookies enabled or disabled.
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

id? method is the norm.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you say "manage your out traffic" do you mean you want to keep track of hits from people leaving your site, or you want to track from where your hits are coming?

if it's the latter, you could always tag on a url var (if you're doing some kind of link campaign) and then dump the value of that var into a db upon arrival to your site. With that schema, you won't be able to track "random" hits to your site however as the party on the other end will have to place a var in the url string to your site in order for that to work. Honestly (albeit flaky) your best solution for tracking incoming hits is HTTP_REFERER.

Burrito
jaymoore_299
Forum Contributor
Posts: 128
Joined: Wed May 11, 2005 6:40 pm
Contact:

Post by jaymoore_299 »

I'm looking to do all these, find out how many and where the surfers are coming from (domain-wise), determine which links they are clicking, and how they exit my page.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

jaymoore_299 wrote:I'm looking to do all these, find out how many and where the surfers are coming from (domain-wise), determine which links they are clicking, and how they exit my page.
Please, PLEASE, read: http://www.analog.cx/docs/webworks.html

Among other things on that well written explanation of how the web works..
You can't tell how many visitors you've had.
You can't tell how many visits you've had.
You often can't tell where they entered your site, or where they found out about you from.
You can't follow a person's path through your site.
You can't tell how they left your site, or where they went next.
Basically, *everything* you want to do is not possible to do in any accurate fashion.

That said, there *are* things you *can* see, that are valuable and that relate to your goals, so read that page.
Post Reply