Alex-- uh, not real clear on what you're asking, but it sounds like: when someone retrieves a web page, I want to trigger a PHP script. Is that right?
If so... maybe you should just make the web page a .php file? :-)
If you give more details, I give a better answer, promise!
best,
Eric