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:

  1. allow users buy via paypal (easy enough)
  2. re-direct users download page (again easy)
  3. 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

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -