There's nothing wrong with using GET-method inputs. Just keep register_globals set to "off" and access them (as in your example) as $_GET['var1'] and $_GET['var2'].
The security hole with register_globals is that it can interfere with your code. Suppose that you have a variable in your code named $var1, to which you concatenate data in a loop without explicitly initializing it to "". Also suppose that the script is not expecting any input whatsoever.
Now suppose I access your script, instead of as
but rather as
I can poison the values of your variables if register_globals is set to "on". Your code is expecting the value of $var1 to be initially equal to "", as PHP does by default -- so you didn't explicitly set it to "" when you first instantiated it. But because of my action, at the beginning of the script run it's set to "foo". Your code, none the wiser, runs into a while loop concatenating data to that variable, then stores the value in a database. Now I can poison the data in your database. Image the fun time you'll have trying to debug your code, especially when it's a data-driven error that you can't duplicate without a web server log analysis.
However, if register_globals is set to "off". $var1 in your code and $_GET['var1'] from input are kept completely separate.
Honestly, the chances of it's being used against you are probably pretty remote. But keeping register_globals set to off and using the superglobal arrays can also make your code more readable and can simplify your code.
Want the best answers? Ask the best questions: TANSTAAFL!