Update signature.php

added logic to check data integrity and used correct variables