you will need to store the ID in a session on the apply page.
on the apply page, change line 66:
$Result1 = mysql_query($insertSQL, $su_lokoja) or die(mysql_error());
to:
$Result1 = mysql_query($insertSQL, $su_lokoja) or die(mysql_error());
$_SESSION['UserID'] = mysql_insert_id($su_lokoja);
then on the thank you page, you can display the id using this code:
<?php
@session_start();
echo(isset($_SESSION['UserID'])?$_SESSION['UserID']:"");
?>