I have a PDF Form that uses php to send the completed form to a file on my server. That way, I can see the completed form and not just the code in an e-mail. I want to php code to take care of sending the form to the server (it does), but then to continue to a payment page. I can't figure out how to do this. I use echo to print a short message and link to the payment page, but would rather skip this middle page.
Thanks for your help in advance!<?

//Step 1: Get the XFDF Raw Data
$XFDFData = file_get_contents('php://input');

//Check it to see if it is empty or too short
if ( strlen($XFDFData)<10)
{
header("Location: http://www.pdfill.com/pdf_action.html#4");
exit;
}

// make the random file name
$randName = md5(rand() * time());

$File = 'Submitted_Forms/' .$randName . '.pdf'; 
$Handle = fopen($File, 'w');
$Data = $XFDFData; 
fwrite($Handle, $Data); 
fclose($Handle); 

$strLink = "http://www.revbootcamp.com/$File";
// echo $strLink;


$to = 'tlctara@comcast.net';
$subject = 'New Registration Form';
$message = 'A new case form has been submitted.  Please click the link to view.
' . $strLink;
$email = 'bruce@revbootcamp.com';
$headers = 'From: ' . $email . "\r\n" .
            'Reply-To: ' . $email . "\r\n" .
          'X-Mailer: PHP/' . phpversion();

mail ($to, $subject, $message, $headers);
echo "<a href='http://www.revbootcamp.com/Payment.html'>Thank You for your submission. Click Here To Pay</a>"; 
?>

Edited 3 Years Ago by Reverend Jim: Fixed formatting

Thank you! That helps. Can I change the font of the "Thank You" message?

Another question: the PDF file that is my form takes a while to load (131 KB). Acrobat won't let me reduce the file size. Any ideas on how to make it smaller?

I appreciate your help!

sure you can change the font.

echo "<font size=5>Thank You</font> for your submission.You will be directed to the payment page.";
This article has been dead for over six months. Start a new discussion instead.