Advertisement
Guest User

Untitled

a guest
Jun 4th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. if (strcmp ($res, "VERIFIED") == 0) {
  2. //Valid request
  3. //The username of the account the payment was ment for (should be) stored in $_POST["custom"]
  4. //Should get to this point every payment each month
  5.  
  6. //Check if valid price, payee, ..etc
  7.  
  8. //add more time to the account based on username and how much they pay for
  9. //for sake of arguement, I'll say 1 month of payment was made, so 2628000 seconds
  10. $time = time() + 2628000;
  11.  
  12. $stmt = $db->prepare("UPDATE accounts SET expire=$time WHERE username=?");
  13. $stmt->bindValue(1, $_POST["custom"], PDO::PARAM_STR);
  14. if(!$stmt->execute()){
  15. //error log
  16. }else{
  17. //successful
  18. }
  19.  
  20. } else if (strcmp ($res, "INVALID") == 0) {
  21. //Fake request
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement