I can't say 100% sure, but PHP is very secure. Getting a variable would be in a sense, "hacking". Javascript might be able to do it. Not get the actual variable, but the same results. Since I don't know what your trying to accomplish, I cant say for sure.
Ex. of what i mean:
I have recent forum posts on my site.I could have used PHP & MySQL Select, but I was able to use JS. I of course didn't write the JS, it is a mod. (i don't know Javascript)
If it is possible, hopefully someone will post.