I've built a "get a quote" plugin for a client; basically a contact form with some extra fields and and some math.
This form is embedded in a landing page and upon submitting it is replaced with a graphic that says "Thank you, we'll be in touch with a quote soon".
For that I use the following structure:
<div>
<?php if( !isset( $submission_message ) || $submission_message == '' ): ?>
<?php include('form.php'); ?>
<?php endif; ?>
<?php if( isset( $submission_message ) || $submission_message != '' ): ?>
<div>
<h1>Thank You!</h1><br/>
<p><?php echo $submission_message; ?></p>
</div>
<?php endif; ?>
</div>
I assumed that bringing in the contact form via the include statement would turn off the form-resubmission issue, but it didn't.
I did some research and found out that I'd have to implement a post/redirect/get pattern, but I would like to avoid a full redirect, i.e. avoid sending the user to a completely different page. Instead I want to hide the form and display the "thank you"-message instead.
I've seen this implemented on other websites, but have no idea how to continue here.