Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2007
    Messaggi
    179

    Errore script registrazione utenti

    Ho creato questo script in php e mysql ma mi da' sempre questo errore e proprio nn capisco dove ho sbagliato uff..Sono ai primi approcci con il php quindi vi prego aiutatemi
    file LOGIN.html
    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Documento senza titolo</title>
    </head>
    
    <body>
    
    <form name="login" method="post" action="login.php">
    <table border="0" width="225" align="center">
        <tr>
            <td width="219" bgcolor="#999999">
                <p align="center"><font color="white"><span style="font-size:12pt;">Login</span></font></p>
            </td>
        </tr>
        <tr>
            <td width="219">
                <table border="0" width="220" align="center">
                    <tr>
                        <td width="71"><span style="font-size:10pt;">Username:</span></td>
                        <td width="139"><input type="text" name="username"></td>
                    </tr>
                    <tr>
                        <td width="71"><span style="font-size:10pt;">Password:</span></td>
                        <td width="139"><input type="password" name="password"></td>
                    </tr>
                    <tr>
                        <td width="71"></td>
                            <td width="139">
                                <p align="right"><input type="submit" name="submit" value="Submit"></p>
                            </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="219" bgcolor="#999999"><font color="white">Not Registered? </font><font color="white">Register</font><font color="white"> </font><font color="white">Now!</font></td>
        </tr>
    </table>
    </form>
    
    </body>
    </html>
    file register.html
    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Documento senza titolo</title>
    </head>
    
    <body>
    
    <form name="login" method="post" action="register.php">
    <table border="0" width="225" align="center">
        <tr>
            <td width="219" bgcolor="#999999">
                <p align="center"><font color="white"><span style="font-size:12pt;">Registration</span></font></p>
            </td>
        </tr>
        <tr>
            <td width="219">
                <table border="0" width="282" align="center">
                        <tr>
                            <td width="116"><span style="font-size:10pt;">Name:</span></td>
                            <td width="156"><input type="text" name="name" maxlength="100"></td>
                        </tr>
                        <tr>
                            <td width="116"><span style="font-size:10pt;">Email:</span></td>
                            <td width="156"><input type="text" name="email" maxlength="100"></td>
                        </tr>
                    <tr>
                        <td width="116"><span style="font-size:10pt;">Username:</span></td>
                        <td width="156"><input type="text" name="username"></td>
                    </tr>
                    <tr>
                        <td width="116"><span style="font-size:10pt;">Password:</span></td>
                        <td width="156"><input type="password" name="password"></td>
                    </tr>
                    <tr>
                        <td width="116"></td>
                            <td width="156">
                                <p align="right"><input type="submit" name="submit" value="Submit"></p>
                            </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="219" bgcolor="#999999"></td>
        </tr>
    </table>
    </form>
    
    </body>
    </html>
    file LOGIN.PHP
    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Documento senza titolo</title>
    </head>
    
    <body>
    
    <?php
    
    //Database Information
    
    $dbhost = "localhost";
    $dbname = "your database name";
    $dbuser = "username";
    $dbpass = "yourpass";
    
    //Connect to database
    
    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());
    
    session_start();
    $username = $_POST[‘username’];
    $password = md5($_POST[‘password’]);
    
    $query = “select * from users where username=’$username’ and password=’$password’”;
    
    $result = mysql_query($query);
    
    if (mysql_num_rows($result) != 1) {
    $error = “Bad Login”;
        include “login.html”;
    
    } else {
        $_SESSION[‘username’] = “$username”;
        include “memberspage.php”;
    }
    
    ?>
    
    </body>
    </html>
    file REGISTER.PHP
    codice:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Documento senza titolo</title>
    </head>
    
    <body>
    
    <?php
    
    //Database Information
    
    $dbhost = "localhost";
    $dbname = "your database name";
    $dbuser = "username";
    $dbpass = "yourpass";
    
    //Connect to database
    
    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());
    
        
    $name = $_POST['name'];
    $email = $_POST['email'];    
    $username = $_POST['username'];
    $password = md5($_POST['password']);
    
    // lets check to see if the username already exists
    
    $checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");
    
    $username_exist = mysql_num_rows($checkuser);
    
    if($username_exist > 0){
        echo "I'm sorry but the username you specified has already been taken.  Please pick another one.";
        unset($username);
        include 'register.html';
        exit();
    }
    
    // lf no errors present with the username
    // use a query to insert the data into the database.
    
    $query = "INSERT INTO users (name, email, username, password)
    VALUES('$name', '$email', '$username', '$password')";
    mysql_query($query) or die(mysql_error());
    mysql_close();
    
    echo "You have successfully Registered";
        
    // mail user their information
    
    $yoursite = ‘www.blahblah.com’;
    $webmaster = ‘yourname’;
    $youremail = ‘youremail’;
        
    $subject = "You have successfully registered at $yoursite...";
    $message = "Dear $name, you are now registered at our web site.  
        To login, simply go to our web page and enter in the following details in the login form:
        Username: $username
        Password: $password
        
        Please print this information out and store it for future reference.
        
        Thanks,
        $webmaster";
        
    mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());
        
    echo "Your information has been mailed to your email address.";
    
    ?>
    
    </body>
    </html>
    TABELLA SQL
    codice:
    CREATE TABLE users (
      userid int(25) NOT NULL auto_increment,
      name varchar(25) NOT NULL default '',
      email varchar(255) NOT NULL default '',
      username varchar(25) NOT NULL default '',
      password varchar(255) NOT NULL default '',
      PRIMARY KEY  (userid),
      UNIQUE KEY username (username)
    ) TYPE=MyISAM COMMENT='Members';
    Per testare il tutto uso lo spazio "altervista.org" con db mysql e php
    L'errore che ricevo e' questo:
    In login.php ->
    Parse error: syntax error, unexpected T_STRING in /membri/cimo/file_registrazione/login.php on line 28
    XCHE!!!!
    uff proprio nn capisco...aiutatemi a risolverlo perfavore...
    Tnx

  2. #2
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    prova a togliere gli apici

    sername=’$username’ and password=’$password’
    e vedi se il problema continua a presentarsi

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2007
    Messaggi
    179
    Ok adesso va' solo ke nn funziona granche' registra l'iscrizione ma poi nel login nn accetta niente..uff...potresti darmi uno script login? devo proteggere pagine del mio sito e renderle visibili solo se l'utente si e' registrato hai niente?
    tnx

  4. #4
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    scusa la banalità, ma...
    hai fatto la stessa cosa che ti ho detto prima anche nel file login.php?

    edit:
    ho visto solo adesso scusa...

    usa include("tuofile.php"). Ah, un'altra cosa... io non sono molto esperto e leggendo qua sul forum ho notato che usare include non sarebbe appropriato ai fini della sicurezza... prova a cercare qualche notizia in più

  5. #5
    Utente di HTML.it
    Registrato dal
    Apr 2007
    Messaggi
    179
    Ciao una cosa..Sai come recuperare la password e l'username recuperandoli dal db inserendo l'e-mail? Ho fatto form e tutto ma nn so' come fare per fargli prendere l'username e la pass dal db inserendo solo l'e-mail =(
    help please...tnx

  6. #6
    Originariamente inviato da CIMO1
    Ciao una cosa..Sai come recuperare la password e l'username recuperandoli dal db inserendo l'e-mail? Ho fatto form e tutto ma nn so' come fare per fargli prendere l'username e la pass dal db inserendo solo l'e-mail =(
    help please...tnx
    Bè la query sql è semplice basta un

    "SELECT username, password
    FROM users
    WHEE email ='email@inserita'"

    Poi ovviamente devi eseguire la query, e magari spedirgli username e password via e-mail.
    "Estremamente originale e fantasioso" By darkiko;
    "allora sfiga crepuscolare mi sa che e' meglio di atmosfera serale" By NyXo;
    "per favore, già è difficile con lui" By fcaldera;
    "se lo apri te e invece di "amore" ci metti "lavoro", l'effetto è lo stesso" By fred84

  7. #7
    Utente di HTML.it
    Registrato dal
    Apr 2007
    Messaggi
    179
    codice:
    <?php
    
    include 'db.php';
    
    $message="Ciao $username_check,\n ecco i dati di accesso che hai richiesto:\n
    nick: $username\n
    password: $random_password\n
    A presto!!\n
    Staff di $nomesito.\n\n\n\n\n";
    
    mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
    $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
    $email_check = mysql_num_rows($sql_email_check);
    
    if(email_check > 0){
    echo "<html>
    <head>
    <meta http-equiv=\"refresh\" content=\"3;url=./index.htm\">
    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
    </head>
    <body>
    <div align=\"center\" class=tit>I dati richiesti sono stati inviati a $email_address</div>
    </body>
    </html>";
    }else{
    echo "Si è verificato un errore
    non è stato possibile inviare i dati richiesti a $email_address";
    }
    ?>
    Questo e' il codice che ho scritto ma nn va'...me la daresti una mano? sono nuovo..anzi nuovissimo al php e sql...
    tnx =)

  8. #8
    Originariamente inviato da CIMO1
    codice:
    <?php
    
    include 'db.php';
    
    $message="Ciao $username_check,\n ecco i dati di accesso che hai richiesto:\n
    nick: $username\n
    password: $random_password\n
    A presto!!\n
    Staff di $nomesito.\n\n\n\n\n";
    
    mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
    $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
    $email_check = mysql_num_rows($sql_email_check);
    
    if(email_check > 0){
    echo "<html>
    <head>
    <meta http-equiv=\"refresh\" content=\"3;url=./index.htm\">
    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
    </head>
    <body>
    <div align=\"center\" class=tit>I dati richiesti sono stati inviati a $email_address</div>
    </body>
    </html>";
    }else{
    echo "Si è verificato un errore
    non è stato possibile inviare i dati richiesti a $email_address";
    }
    ?>
    Questo e' il codice che ho scritto ma nn va'...me la daresti una mano? sono nuovo..anzi nuovissimo al php e sql...
    tnx =)
    Inanzi tutto devi selezionare Username è Password e non l'email, seconda cosa nel database che hai postato piu su il campo si chiama email e non emailadess.
    Ad ogni modo la query che ti ho scritto sopra è giusta, sostituiscila alla tua e se hai cambiato i nomi dei campi del database modificiali.

    Nella tua select ci sta un errore di fondo, te la riporto qui:

    codice:
    SELECT email_address FROM users WHERE email_address='$email_address'
    Perchè selezioni l'e-mail se quel che ti interessa è la password?

    Ti do un paio di trucchetti inanzi tutto lep rime tre cose che devi scrivere di una query sono:

    SELECT (se stiamo parlando di selezione)
    FROM
    WHERE

    Il prima domanda che ti devi fare è da quali tabelle devo pescarli i dati? e compili il campo from. Poi ti chiedi "che dati mi servono?" e compili il campo select e solo per ultimo compili il where.

    Un altro trucco è quello di provare prima di ogni altra cosa la query con phpmyadmin, cosi vedendo la tabella che ti crea sai se la query e giusta. Solo dopo la inserisci nel resto del codice. Almeno cosi se qualcosa non va puoi dire a priori che la parte Sql è senza errori.

    P.S: Scusami se sono stato un po lungo, non volevo fare la parte del saccente
    "Estremamente originale e fantasioso" By darkiko;
    "allora sfiga crepuscolare mi sa che e' meglio di atmosfera serale" By NyXo;
    "per favore, già è difficile con lui" By fcaldera;
    "se lo apri te e invece di "amore" ci metti "lavoro", l'effetto è lo stesso" By fred84

  9. #9
    Utente di HTML.it
    Registrato dal
    Apr 2007
    Messaggi
    179
    No anzi piu' mi parli e piu' mi aiuti una cosa:
    Questo e' il mio file register.php
    codice:
    <?
    
    include 'db.php';
    
    if(!eregi("^[a-z]{5,15}$",$first_name)){
    echo "Nome non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if(!eregi("^[a-z]{5,15}$",$last_name)){
    echo "Cognome non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if (!eregi( "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$",$email_address)){
    echo "E-mail non valida ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if(!eregi("^[0-9a-z]{4,10}$",$username)){
    echo "Username non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    // Define post fields into simple variables
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $email_address = $_POST['email_address'];
    $username = $_POST['username'];
    
    /* Lets strip some slashes in case the user entered
    any escaped characters. */
    
    $first_name = stripslashes($first_name);
    $last_name = stripslashes($last_name);
    $email_address = stripslashes($email_address);
    $username = stripslashes($username);
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
     $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
     $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$username'");
    
     $email_check = mysql_num_rows($sql_email_check);
     $username_check = mysql_num_rows($sql_username_check);
    
     if(($email_check > 0) || ($username_check > 0)){
     	if($email_check > 0){
     		echo "[b]La tua E-mail risulta gia\' registrata nel nostro database. Inserisci una diversa E-mail!
    ";
     		unset($email_address);
     	}
     	if($username_check > 0){
     		echo "L\' Username risulta gia\' registrato nel nostro database. Inserisci un diverso Username!
    ";
     		unset($username);
     	}
     	include 'join_form.php'; // Show the form again!
     	exit();  // exit the script so that we do not create this account!
     }
    
    /* Everything has passed both error checks that we have done.
    It's time to create the account! */
    
    /* Random Password generator.
    http://cimo.altervista.org/file_regi...passRandom.php
    
    We'll generate a random password for the
    user and encrypt it, email it and then enter it into the db.
    */
    
    function makeRandomPassword() {
      bla bla =P
      	$i = 0;
      	while ($i <= 7) {
        		$num = rand() % 33;
        		$tmp = substr($salt, $num, 1);
        		$pass = $pass . $tmp;
        		$i++;
      	}
      	return $pass;
    }
    
    $random_password = makeRandomPassword();
    
    $db_password = md5($random_password);
    
    // Enter info into the Database.
    $info2 = htmlspecialchars($info);
    $sql = mysql_query("INSERT INTO users (first_name, last_name, email_address, username, password, info, signup_date, decrypted_password)
    		VALUES('$first_name', '$last_name', '$email_address', '$username', '$db_password', '$info2', now(), '$random_password')") or die (mysql_error());
    
    if(!$sql){
    	echo 'Errore nel creare il tuo account!! Contatta il WebMaster.';
    } else {
    	$userid = mysql_insert_id();
    	$activatepath = "activate.php?id=$userid&code=$db_password";
    	// Let's mail the user!
    	$subject = "Richiesta registrazione $sitename";
    	$message = "$first_name $last_name,
    	Hai inviato la registrazione su $sitepath
    
    	Per attivare il tuo account, clicca qui: $sitepath$activatepath
    
    	I tuoi dati:
    	Username: $username
    	Password: $random_password
    	
    	CONSERVA QUESTI DATI XCHE' PER LA TUA PRIVACY E QUELLA DEGLI ALTRI I DATI SONO CRIPTATI!!
    
    	Grazie!
    	WebMaster, $sitename
    
    	Questa E-mail viene generata automaticamente quindi non rispondere!";
    
    	mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    	
    	echo 'La tua richiesta e\' stata inviata alla tua E-mail controlla!';
    }
    ?>
    E questo e' il mio file rec.php
    codice:
    <?php
    
    include 'db.php';
    
    $message="Ciao $username_check,\n ecco i dati di accesso che hai richiesto:\n
    nick: $username\n
    password: $random_password\n
    A presto!!\n
    Staff di $nomesito.\n\n\n\n\n";
    
    mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
    $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
    
    if(email_check >0){
    echo "<html>
    <head>
    <meta http-equiv=\"refresh\" content=\"3;url=./index.htm\">
    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
    </head>
    <body>
    <div align=\"center\" class=tit>I dati richiesti sono stati inviati a $email_address</div>
    </body>
    </html>";
    }else{
    echo "Si è verificato un errore
    non è stato possibile inviare i dati richiesti a $email_address";
    }
    ?>
    Voglio che quando mi sono registrato e tutto .. mettiamo per un fulmine che mi colpisce mentre sto' cac... al bagno mi dimentico la pass ke ho trovato nell'e-mail che mi e' stata inviata e voglio richiederla nuovamente e essere inviata alla mia e-mail

    Be' ho fatto questi de file...ma nn va'...dove sbaglio aiutami ti prego voglio capire davvero e risolvere!!

    E poi ho notato che nel db quando mi registro la mia e-mail viene tagliata?!!?
    codice:
    email_address -> 'simone.dagostino@gmail.co'
    Mi dai una mano? tnx =)

  10. #10
    Originariamente inviato da CIMO1
    No anzi piu' mi parli e piu' mi aiuti una cosa:
    Questo e' il mio file register.php
    codice:
    <?
    
    include 'db.php';
    
    if(!eregi("^[a-z]{5,15}$",$first_name)){
    echo "Nome non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if(!eregi("^[a-z]{5,15}$",$last_name)){
    echo "Cognome non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if (!eregi( "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$",$email_address)){
    echo "E-mail non valida ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    if(!eregi("^[0-9a-z]{4,10}$",$username)){
    echo "Username non valido ";
    echo "<a href=\"./join_form.php\">Torna</a>";
    exit;
    }
    
    // Define post fields into simple variables
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $email_address = $_POST['email_address'];
    $username = $_POST['username'];
    
    /* Lets strip some slashes in case the user entered
    any escaped characters. */
    
    $first_name = stripslashes($first_name);
    $last_name = stripslashes($last_name);
    $email_address = stripslashes($email_address);
    $username = stripslashes($username);
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
     $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
     $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$username'");
    
     $email_check = mysql_num_rows($sql_email_check);
     $username_check = mysql_num_rows($sql_username_check);
    
     if(($email_check > 0) || ($username_check > 0)){
     	if($email_check > 0){
     		echo "[b]La tua E-mail risulta gia\' registrata nel nostro database. Inserisci una diversa E-mail!
    ";
     		unset($email_address);
     	}
     	if($username_check > 0){
     		echo "L\' Username risulta gia\' registrato nel nostro database. Inserisci un diverso Username!
    ";
     		unset($username);
     	}
     	include 'join_form.php'; // Show the form again!
     	exit();  // exit the script so that we do not create this account!
     }
    
    /* Everything has passed both error checks that we have done.
    It's time to create the account! */
    
    /* Random Password generator.
    http://cimo.altervista.org/file_regi...passRandom.php
    
    We'll generate a random password for the
    user and encrypt it, email it and then enter it into the db.
    */
    
    function makeRandomPassword() {
      bla bla =P
      	$i = 0;
      	while ($i <= 7) {
        		$num = rand() % 33;
        		$tmp = substr($salt, $num, 1);
        		$pass = $pass . $tmp;
        		$i++;
      	}
      	return $pass;
    }
    
    $random_password = makeRandomPassword();
    
    $db_password = md5($random_password);
    
    // Enter info into the Database.
    $info2 = htmlspecialchars($info);
    $sql = mysql_query("INSERT INTO users (first_name, last_name, email_address, username, password, info, signup_date, decrypted_password)
    		VALUES('$first_name', '$last_name', '$email_address', '$username', '$db_password', '$info2', now(), '$random_password')") or die (mysql_error());
    
    if(!$sql){
    	echo 'Errore nel creare il tuo account!! Contatta il WebMaster.';
    } else {
    	$userid = mysql_insert_id();
    	$activatepath = "activate.php?id=$userid&code=$db_password";
    	// Let's mail the user!
    	$subject = "Richiesta registrazione $sitename";
    	$message = "$first_name $last_name,
    	Hai inviato la registrazione su $sitepath
    
    	Per attivare il tuo account, clicca qui: $sitepath$activatepath
    
    	I tuoi dati:
    	Username: $username
    	Password: $random_password
    	
    	CONSERVA QUESTI DATI XCHE' PER LA TUA PRIVACY E QUELLA DEGLI ALTRI I DATI SONO CRIPTATI!!
    
    	Grazie!
    	WebMaster, $sitename
    
    	Questa E-mail viene generata automaticamente quindi non rispondere!";
    
    	mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    	
    	echo 'La tua richiesta e\' stata inviata alla tua E-mail controlla!';
    }
    ?>
    E questo e' il mio file rec.php
    codice:
    <?php
    
    include 'db.php';
    
    $message="Ciao $username_check,\n ecco i dati di accesso che hai richiesto:\n
    nick: $username\n
    password: $random_password\n
    A presto!!\n
    Staff di $nomesito.\n\n\n\n\n";
    
    mail($email_address, $subject, $message, "From: $sitename <$adminemail>\nX-Mailer: PHP/" . phpversion());
    
    /* Let's do some checking and ensure that the user's email address or username
     does not exist in the database */
    
    $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");
    
    if(email_check >0){
    echo "<html>
    <head>
    <meta http-equiv=\"refresh\" content=\"3;url=./index.htm\">
    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
    </head>
    <body>
    <div align=\"center\" class=tit>I dati richiesti sono stati inviati a $email_address</div>
    </body>
    </html>";
    }else{
    echo "Si è verificato un errore
    non è stato possibile inviare i dati richiesti a $email_address";
    }
    ?>
    Voglio che quando mi sono registrato e tutto .. mettiamo per un fulmine che mi colpisce mentre sto' cac... al bagno mi dimentico la pass ke ho trovato nell'e-mail che mi e' stata inviata e voglio richiederla nuovamente e essere inviata alla mia e-mail

    Be' ho fatto questi de file...ma nn va'...dove sbaglio aiutami ti prego voglio capire davvero e risolvere!!

    E poi ho notato che nel db quando mi registro la mia e-mail viene tagliata?!!?
    codice:
    email_address -> 'simone.dagostino@gmail.co'
    Mi dai una mano? tnx =)
    Allora inanzi tutto la query giusta di rec.php te l'ho scritta più su, inzia con aggiustarla.
    L'e-mail non so perchè ti viene troncata se il DB è quello di sopra sicuramente non sfori nei 255 caratteri. L'altra cosa che mi viene in mente è che magari il campo del form che compili per l'e-mail ha impostato una lunghezza massima troppo piccola? potrebbe essere?

    Ti ripeto il consiglio inizia a controllarti tutte le query con phpmyadmin e vedi se creano l'effetto desiderato. Cosi ad occhio e croce non so dirti anche perchè non ho nulla di installato per fare le prove, poi credo che sia piu utile che impari a scovare da te gli errori

    Se poi hai Msn il mio indirizzo è nel profilo, puoi contattarmi li e ti aiuto in tempo reale
    "Estremamente originale e fantasioso" By darkiko;
    "allora sfiga crepuscolare mi sa che e' meglio di atmosfera serale" By NyXo;
    "per favore, già è difficile con lui" By fcaldera;
    "se lo apri te e invece di "amore" ci metti "lavoro", l'effetto è lo stesso" By fred84

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.