If you want to use javascript to ecode it, use the escape() function.
BTW: if you want to hardcode it, use this:
blah.php?blah=%23blah
23 is the hex value of #. The percent indicates a hex value.
In your PHP, this will be translated back to a #
-sridhar