| | |
Continue to url after form submit
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 4
Reputation:
Solved Threads: 0
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>";
?>
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>";
?>
•
•
Join Date: Apr 2008
Posts: 4
Reputation:
Solved Threads: 0
I want ot go directly to http://www.revbootcamp.com/Payment.html
ok,you can use javascript for these.
Replace these:
with this:
Replace these:
php Syntax (Toggle Plain Text)
echo "<a href='http://www.revbootcamp.com/Payment.html'>Thank You for your submission. Click Here To Pay</a>";
with this:
php Syntax (Toggle Plain Text)
echo "Thank You for your submission.You will be directed to the payment page."; echo ' <script type="text/javascript"> function timedMsg() { window.location = "http://www.revbootcamp.com/Payment.html"; } setTimeout("timedMsg()", 5000); </script>';
Last edited by ryan_vietnow; Apr 10th, 2008 at 11:55 pm.
sure you can change the font.
php Syntax (Toggle Plain Text)
echo "<font size=5>Thank You</font> for your submission.You will be directed to the payment page.";
![]() |
Other Threads in the PHP Forum
- Previous Thread: PHP and MySQL Multipage form
- Next Thread: JPGraph+Help
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube





