Visualizzazione dei risultati da 1 a 4 su 4

Discussione: recupero password

  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2006
    Messaggi
    656

    recupero password

    ciao raga,

    devo realizzare una paginetta per il recupero della password,

    mi vedete per favore se è coretto?
    Codice PHP:
    <?php require('/Connections/gcv.php'); ?>


    <?php
    mysql_select_db
    ($database_gcv$gcv);
    $query_Recordset1 "SELECT password FROM `user` WHERE USERNAME = $_GET[username]";
    $Recordset1 mysql_query($query_Recordset1$gcv) or die(mysql_error());
    $row_Recordset1 mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 mysql_num_rows($Recordset1);
    ?>


    <?php
    //varie info per email
    $oggi date("j F Y G:i");
    $ip "$_SERVER[REMOTE_ADDR]";
    $to "$_GET[username]";
    $soggetto "password";

    $body "Modulo inviato il $oggi da $ip - $browser \n\n";
    $body .= "USername: $_GET[nome] \nPASS: $_POST[email] \ ";

    mail("$to","$soggetto","$body");
    header ("Location: [url]http://lnx.xxxxxxxxx.com/successo.php[/url]");
    ?>

    non socome fare per impostare l'indirizzo email dell'utente e la password, in modo tale che venga inserito nella mail.

  2. #2
    Utente bannato L'avatar di Skyline89
    Registrato dal
    Jun 2006
    Messaggi
    225
    ma scusa nn cripti le email?


    poi sei sicuro che il link abbaia quei due get???

    ?username=email@email.ext&nome=username


    e il post da dove lo prendi? :master:

    ps: il tag <?php ?> lo puoi aprire all'inizio e chiuderlo alla fine

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2006
    Messaggi
    656
    come si cripta la email?


    cmq, dopo tentativi, sono arrivato a questo.

    Codice PHP:
    <?php require('Connections/xxx.php'); ?>


    <?php
    mysql_select_db
    ($database_gcv$gcv);
    $query_Recordset1 "SELECT password FROM `user` WHERE username = '$_POST[username]'";
    $Recordset1 mysql_query($query_Recordset1$gcv) or die(mysql_error());
    $row_Recordset1 mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 mysql_num_rows($Recordset1);

    mysql_select_db($database_gcv$gcv);
    $query_Recordset2 "SELECT email FROM `user` WHERE username = '$_POST[username]'";
    $Recordset2 mysql_query($query_Recordset2$gcv) or die(mysql_error());
    $row_Recordset2 mysql_fetch_assoc($Recordset2);
    $totalRows_Recordset2 mysql_num_rows($Recordset2);



    //varie info per email
    $oggi date("j F Y G:i");
    $ip "$_SERVER[REMOTE_ADDR]";
    $soggetto "pass";
    $to ="$Recordset2"

    $body "Ecco i tuoi dati: \nPassword: $Recordset1   \nUsername: $_POST[username]";

    mail("$to","$soggetto","$body");
    header ("Location: [url]http://xxxx.com/successo.php[/url]");
    ?>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento senza titolo</title>
    </head>

    <body>
    </body>
    </html>
    <?php
    mysql_free_result
    ($Recordset1);

    mysql_free_result($Recordset2);
    ?>
    non funziona neanche cosi!

  4. #4
    Utente bannato L'avatar di Skyline89
    Registrato dal
    Jun 2006
    Messaggi
    225
    scusami ma i $_POST['username'] da dove lo prendi???

    SELECT password, email FROM `user` WHERE username = '$_POST[username]'

    così prendi i due campi con una sola query

    e poi l'email credo che arrivi in SPAM

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.