Registration confirmation

Asked

Viewed 54 times

0

I am trying to send an email to validate the registration of a user, this and my code.

    $id = mysql_insert_id($connect);

    // Criar as variaveis para validar o email
    $url =sprintf( 'id=%s&email=%s&uid=%s&key=%s',$id, md5($email), 
    md5($uid),md5($data_ts));


    $mensagem = 'Para confirmar seu cadastro acesse o link:'."\n";
    $mensagem .= sprintf('http://www.gomap.eco.br/ativar.php?%s',$url);

    $headers = "From:".$from;
    mail($to,$subject,$mensagem,$headers);

But when I put that part the email is not sent: $id = mysql_insert_id($connect);

What should I do?

  • Which version of PHP?

  • This extension has been deprecated since PHP 5.5.0 and has been removed in PHP 7.0.0. Use Mysqli or Pdo_mysql alternatively. http://php.net/manual/en/function.mysql-insert-id.php

  • Thanks, it worked out !

  • No error appears on the screen, or in the error logs you have checked?

1 answer

0

The extent mysql is obsolete, in its place use the mysqli. For more details see documentation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.