$subject

$comment

XML; $query = << 0 goto finish; -- Add a comment vote exec @status = vote_property @cookie, @propid, 0.5, 0.5, @voteid output if @status <> 0 goto finish; -- Add comment to vote exec @status = add_comment @cookie, @voteid, N'$xml', @commentid output; --!!! -- Clean up finish: if @@trancount > 0 begin if @status = 0 commit transaction else rollback transaction end select @status, @commentid; QUERY; $status = getSingleValue($query); if ( $status == 0 ) { $message = "Your comment has been registered. Thank you."; } restore_error_handler(); } else { $errors .= "You must be logged in to post comments. Please log in and try again."; } } else { $errors .= "You must supply both a nodeid, subject and comment text."; } if ( isset($mssqlerr) ) { $errors .= "$mssqlerr"; } if ( $errors != "" ) { $errors = "Failed to add comment.$errors"; } printXMLData( "$errors$message", 'message.xsl' ); ?>