Continue to url after form submit

Reply

Join Date: Apr 2008
Posts: 4
Reputation: tlctara is an unknown quantity at this point 
Solved Threads: 0
tlctara tlctara is offline Offline
Newbie Poster

Continue to url after form submit

 
0
  #1
Apr 10th, 2008
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>";
?>
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Continue to url after form submit

 
0
  #2
Apr 10th, 2008
Do you want a message box or a page?
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: tlctara is an unknown quantity at this point 
Solved Threads: 0
tlctara tlctara is offline Offline
Newbie Poster

Re: Continue to url after form submit

 
0
  #3
Apr 10th, 2008
I want ot go directly to http://www.revbootcamp.com/Payment.html
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Continue to url after form submit

 
0
  #4
Apr 10th, 2008
ok,you can use javascript for these.

Replace these:
  1. echo "<a href='http://www.revbootcamp.com/Payment.html'>Thank You for your submission. Click Here To Pay</a>";

with this:
  1. echo "Thank You for your submission.You will be directed to the payment page.";
  2.  
  3. echo '
  4. <script type="text/javascript">
  5. function timedMsg()
  6. {
  7. window.location = "http://www.revbootcamp.com/Payment.html";
  8.  
  9. }
  10. setTimeout("timedMsg()", 5000);
  11. </script>';
Last edited by ryan_vietnow; Apr 10th, 2008 at 11:55 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: tlctara is an unknown quantity at this point 
Solved Threads: 0
tlctara tlctara is offline Offline
Newbie Poster

Re: Continue to url after form submit

 
0
  #5
Apr 11th, 2008
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!
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Continue to url after form submit

 
0
  #6
Apr 11th, 2008
sure you can change the font.

  1. echo "<font size=5>Thank You</font> for your submission.You will be directed to the payment page.";
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC