Update compare.php

Modify validation. Add run function