Google itself has a robots.txt that blocks certain places on its website.
Alternatively, if it's just Googlebot that is crawling your comments page, you could most likely block Googlebot from posting by identifying and checking for it's User Agent (I believe it has a unique, identifying user agent) in your PHP script.
The robots.txt would, of course, be the preferred method however.