PayPal security with php


Good, first of all say that I spend a lot of time researching and I can not find something that satisfies me.

It turns out that you can not make sure otherwise using the odd form that gives us paypal and validate with your ipn but then I find this: See example , you do not use the form.

  • header location does not work
  • CURL does not work for me
  • it's no use passing it through get
  • the file_get_contents does not work

I would like someone to really help out on this if it's not too much to ask. By the way when I say that it does not work I do not mean that the function does not work, ojito with that :)

asked by Iranh Canul May 24.02.2017 в 23:48

1 answer


Try eston,

1.- Generate the form on your website

 function activar(){
  var nombre = $("#nombre").val();
  var apellido = $("#apellido").val();
  var correo = $("#correo").val();
  var total = $("#total").val();
  var numerocliente = '001';
  var moneda = 'USD';
  var descuento = '0';
  window.location="[email protected]&currency_code="+moneda+"&item_name=nombredelaweb&charset=utf-8&amount="+total+"&discount_amount="+descuento+"&quantity=1&first_name="+nombre+"&last_name="+apellido+"&email="+correo+"&custom="+numerocliente+"";
<script src=""></script>
<!DOCTYPE html>
    <input type="text" name="nombre" id="nombre">
    <input type="text" name="apellido" id="apellido">
    <input type="text" name="correo" id="correo">
    <input type="number" name="total" id="total">
    <button type="button" onclick="activar()">ACTIVAR BOTON</button> 

this in online mode sends you to the paypal form already with the pre-filled data and you can use it to be a bit dynamic, the possibilities are endless

And with respect to ipn you can configure that the response of the data is by means of url, it is in the paypal configuration where it redirects you.

answered by 28.02.2018 в 21:07