php - Automatically adding a unique number to a PDF download -
i have client sells gift vouchers online - have piece of software use allocate numbers certificates, can't used more once - when hands in voucher enter number on computer, means if else has same number it's not going accepted.
this easy enough when selling @ shop, want sell them online *using paypal payment gateway). have design of certificates, need able following:
- allow users buy via paypal (easy enough)
- re-direct users download page (again easy)
- this gets hard, need every download have unique number on somewhere - when print number on i.e. not file name.
this easy enough on webpage, add 1 number on every view, ideally in pdf format.
i can use numbers (in order) 100 - 10,000.
does know best way go this?
firstly want atleast add check digit top stop people guessing next number in sequence. $gift_code = $random_number . check_digit( $random_number );
this not foolprof, idally should generate set of numbers existing software , go though list. store in db , mark them sold after each sale.
for pdf part, use http://www.fpdf.org/ or http://www.php.net/manual/en/intro.pdf.php use image have of gift certificate background of pdf annd add giftcard code text.
hope helps. luck!
Comments
Post a Comment