in the server behavior that will process the form, sending an email or storing the information in a database, set the redirect to go back to itself using a querystring variable, example:
index.php?proc=1
you can then use an if statement to display the form or the thank you message based on the querystring variable:
<?php if(isset($_GET['proc']) && $_GET['proc'] == 1) { ?>
Form was submitted message
<?php } else { ?>
Form here
<?php } ?>