You are passing ?code=<? echo "test"; ?> ? Why not pass the value "test" and then echo $code?
If you are really intent on passing PHP code via the URL (which is not recommended) use the eval function.
PHP: eval - Manual
Also, you should include <?
php on your beginning tag.