>>870
ソース内の「print」を一括置換で、
「$tempdata .=」に変えておいて、
処理の最後で
print htmlspecialchars($tempdata);