Confirm of received (Email)

0

As I can do to add a link in an Email , in which, when the recipient click , open a page with a message and I am notified .

I will try to explain a little better.
At my university, when they send us an email, at the end is a link , when I click on it, it opens a page where it says that the reception of the message has been confirmed .
But if I click again, another page opens that says it is not necessary to confirm the reception again

Then I want to do something similar, but I can not do it!

I hope you can help me, Thanks

    
asked by DevNX 15.10.2018 в 00:31
source

1 answer

0

I would do the following:

1.- a table SENDS, with three fields: id, code, received.

id: autonumerico
codigo: string
recibido: booleano por defecto false.

2.- In the process of sending an email, we first generate a code, and add it to the "send" table. Something kind:

$codigo = uniquid();
$query = "INSERT into ENVIOS (codigo) values ('".$codigo."');
// ejecuta la query.
// que el enlace que generas acabe con el codigo.
$enlace = "http://www.pagina.com/recibidos.php?codigo=".$codigo;

3.- the page recibidos.php has to read the code, and look for it in bbdd. If you find it, ACTUALIZA in the table:

$codigo = $_GET['codigo'];
$query = "SELECT recibido FROM ENVIOS where codigo ='".$codigo."'";

// execute the query if the received value is true:

echo "No hace falta volver a verificar el correo";

If the value is false, we update the table and show the message:

$query = "UPDATE ENVIOS set recibido= true where codigo='".$codigo."'";
// ejecuta la query
echo "Gracias por confirmar la recepcion"
    
answered by 15.10.2018 в 00:46