It is just a function to check the current page, see if it is under SSL, and redirect them if it isnt. Placement all depends on your current file structure. If you have something like a config file that is included before everything else, then that would be a good place to put it.
i.e.
$SSL = $_SERVER['HTTPS'];
if($SSL !== 'on') header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
As for finding the certificate on the page ... you cant. You can double click the lock on your browser to view the certificate information, but it doesnt actually output anything to the browser.