Quote:
Originally Posted by tsinvestments
Decaf, would I have to pay you to try to get step by step instructions from you?
|
Umm, I consider my self to suck at programming. But i would be more then happy to try to walk you through or a "real programmer" could assist.
What would you like to know more about? Or do you just want me to really detail it out?
Detailed:
1) Create a unique id for the user
1.1) Generate a random length (10-15 characters)
1.2) For each character, generate a random number (1-36) (a-z and 0-9)
1.3) If you really want to you can toss in extra conditions (Ex. 5th char must not be a d,o,e,7, or 3)
1.3.1) Or mix up the numbers (rand(1,$max) $key[rand] = $temp;$key[rand] = $key[rand2];$key[rand2] = $temp; )
2) "sha1($id)" the id and save it in a database
3) Direct the user to the page so they can get there eBook
3.1) Ex. "Click here to go to the download page"!
3.5) Make the user submit a form/button/captcha that will send the id to a DB
3.5.1) Ex. "Click this button to download $bookTitle" // More personalized.
3.75) Check there submitted and hashed Id against all the temp ones saved in the database.
3.75.1) foreach($storedID as $id) { if ($userID == $storedID[$n]) { setcookie("confirm",acceptDownload);header("Loatio n: DOWNLOAD PAGE");}
3.8) Record there IP, email, date, time, book, id and store in a separate DB. (On downlod page).
3.8.1) $_SERVER['REMOTE_ADDR'], $email, date(d/m/y); ect...
4) Give them there book if the hashed id's match and delete the ID so they can't reuse it<meta http-equiv="refresh" content="0;url=http://full/path/to/books" />
5) Direct them back to your home page/more of your books.
"Click here to go to our home page, $name".
Something like that, or use a
Shopping Cart Software to save coding.