Pete -
You can try converting all the spaces to underscores before passing them, using something like this:
$row[0] = str_replace(" ", "_", $row[0]);
then you can convert them back to spaces in the other PHP file:
$viewer = str_replace("_", " ", $viewer);
keep in mind that if the username actually has an underscore in it, it will be converted to a space using this code, so you may have to use a different character than an underscore as the replace character (maybe %20) ?
good luck.
-Jim Keller
http://www.centerfuse.net