I currently have a form that redirects to an email handler php file. Currently we email the user a pdf when they submit the form, but I'd like to change it to where the pdf just opens in a new tab when submitted. Don't mind the terrible naming conventions. The below code is giving me a WordPress error, and I'm not sure how to get it working properly.
<?php
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="$_POST["cm-f-djuiyhkr"]');
readfile($_POST['cm-f-djuiyhkr']);
?>