Grabbing a php variable from a URL

hey all,
have a question. i am adding my flash file to a php cart for an experiment. I am curious. how can i grab a variable from a url to query a database for information?