I am trying to work out a script to log IPs from poll votes on a message board, that will only be fired off if a vote is cast in one of our polls. Edit: I'm doing this via a web beacon, because I don't have access to the poll's programming. /edit
When the script fires off, it needs to know which poll is being voted in, since there are often multiple polls that are open at the same time, and log the IP of voters in a flat file that is dedicated to that poll.
First, I grab the referring URL, which is formatted like this:
http://subdomain.sample.com/t12345,action=vote
If 'vote' is found in the referring URL, the next thing I want to do is grab that t# and turn it into a variable, so I can log info in a file named t12345.txt or 12345.txt, either-or doesn't really matter, as long as it matches the topic number of the poll.
The numbers after the /t are the only thing that should change in this URL. There are currently 5 digits here, and I don't expect this to change any time soon.
My question is: How do I grab this t# from the URL and create a variable from it?
Thank you in advance!