I need to be able to capture a referring URL and then match a phone number in a simple text file that can be loaded into a directory on my site. I want the capture to happen via a server side script. I guess I'm wanting this to be as reliable as possible, so I'm not sure whether Java would be a good choice. The needs for this project are:
1. Match a phone number to urls entered in my text file (e.g. [login to view URL], [login to view URL], [login to view URL] etc.)
2. Match a phone number to the value of a 'phone-id' variable inserted into the urls of links to my site. The referring URL in these situations would look like http:/[login to view URL], where 456 would match a phone number in the text file.
3. A default number displayed if no match was found.
4. A cookie would also be needed to attach to the visitor, so that other pages on my site can display the same phone number that matches their original referring URL. I am planning to use this script on ASP and PHP sites, so if there's a script that can work on both, that would be great.