Guest User

response.php

a guest
Dec 14th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <?php
  2.  
  3. $host="localhost";
  4. $dbUser="wifi_rarkom_2016";
  5. $dbPassword="wifi_rarkom_2016";
  6. $dbName="ifpt";
  7.  
  8. $value=mysqli_connect($host,$dbUser,$dbPassword,$dbName) or die(mysqli_error());
  9. include_once 'easepay-lib.php';
  10. $SALT='I4R3IJICRY';
  11. $result = response( $_POST, $SALT );
  12. $hash=$_POST['hash'];
  13. $firstname=$_POST['firstname'];
  14. $amount=$_POST['net_amount_debit'];
  15. $email=$_POST['email'];
  16. $phone=$_POST['phone'];
  17. $easepayid=$_POST['easepayid'];
  18. $addedon=$_POST['addedon'];
  19. $status=$_POST['status'];
  20. $txnid=$_POST['txnid'];
  21. if ($status=="success") {
  22. # code...
  23. $query ="INSERT INTO payment(hash,firstname,net_amount_debit,email,phone,easepay_id,added_on,status,txn_id) VALUES('$hash','$firstname','$amount','$email','$phone','$easepayid','$addedon','$status','$txnid');";
  24. $query .="UPDATE user SET status_madePayment=1,payment_Renewal=1 WHERE email = '$email';";
  25. $sql=mysqli_multi_query($value,$query);
  26. // print_r($result);
  27. // print_r($_POST);
  28. // if ($query) {
  29. # code...
  30. // }
  31. // echo json_encode($_POST);
  32. // echo json_encode($result);
  33. echo "Payment Completed Successfully";
  34. // sleep(10);
  35. header("Location: http://localhost:8000/user/membership?status=success");
  36. // echo " <a href=\"http://localhost:8000/user/membership\">Goto Profile</a>";
  37. } else{
  38. $query ="INSERT INTO payment(hash,firstname,net_amount_debit,email,phone,easepay_id,added_on,status,txn_id) VALUES('$hash','$firstname','$amount','$email','$phone','$easepayid','$addedon','$status','$txnid');";
  39. $sql=mysqli_query($value,$query);
  40. header("Location: http://localhost:8000/user/membership?status=failure");
  41. }
  42.  
  43.  
  44. ?>
Add Comment
Please, Sign In to add comment