You can't. Sorry. Not without good ol' JavaScript. And here's why.
See, PHP is the server doing all the thinking. And in order for it to do the thinking, you have to tell it to think. Once your computer get the webpage fully loaded, the server is done thinking. Now...JavaScript makes your computer do the thinking. So it can check if to boxes match. Now, here are your options.
1: Make PHP check and see if they match after the user clicks submit.
2. Make Javascript check and see if they match before the user clicks submit.
Or... if you REALLY want PHP to check....
3. Make JavaScript asynchronously call a PHP function or page to check the two emails. Look into AJAX a little bit.
But seriously... just use JavaScript.