Sunday, April 5, 2009

Example Adobe PHP

Example:
SQL Database:
transaction_id (Primary key)
user_id
Datafields1..,...Datafields n


page.php
setcookie(...set your unique identifer);
location("Header: form.php");

form.php
Insert PDF and have an HTML submit pointed to process.php (Using Life cycle)

process.php
insert data into the SQL Table with 0 as the User ID.
Capture the Transaction ID.
Set it as a cookie.
setup a meta-refresh to point to finish.php

finish.php
Update the SQL table with the user ID which was set in Page.php under whatever cookie name.
Grade the Transaction ID from the cookie in Process.php
SQL Update command...Done.

You now have a way around the problem of not being able to add dynamic values to a pdf file.

I hope you find this methodology somewhat useful!
I spent hours googling for something similar, so I hope you found it before spending too much time searching!

I will be creating a more standardized version of this with a proper class structure and what not to assist people but generalizing this is going to be a pain...and im pretty lazy :P

anyway till next post. PC

No comments:

Post a Comment