Changing Flash Variables in PHP

I’d simply like to know how to change Flash variables in PHP, and how to make a file copy into it’s own folder or something, and make PHP(or even Flash) give the URL for it.