I was trying something like this the other day and came across a problem with newlnes -- php functions that were getting called were resulting in output with newlines on the end.. Try view-source:http://yourdoamin.com/yourscripturl.php?qs and see what the actual output is.. rogue new lines are my guess. Sam