Triggering a php script when a call comes in?

We have a php script that is ready to accept incoming CID info and pass it to one of our representative with a link to a related customer record in our company database. What we need to figure out is how to trigger that php script when a call comes in and pass to it a few variables about that call (like the CID info).

[color=#FF4000]So, my question is this: [/color]How can I pass a variable containing the CID information for the current incoming call to a php script in such a way that a lookup can be made in our database and a record could be presented to one of our phone reps before they pick up the phone?

Normally such applications have other requirements that dictate that you use AMI. However, otherwise, use AGI, or, with some care in the secure handling of parameters, the System application.

All these are described in Asterisk: The Future of Telephone (see asteriskdocs.org/).