Ciao a tutti da ieri sera sto provando a far funzionare questo semplice script di registrazione.
Quando provo a registrarmi mi restituisce: Not found your email in our databaseCannot send Confirmation link to your e-mail address
Non riesco proprio capire dove sbaglio, spero che voi riusciate ad aiutarmi.
Vi ringrazio per il vostro tempo ed aiuto.
Ecco le due pagine, signup.php e signup_ac.php
Codice PHP:
<html>
<head>
</head>
<body>
<table width="350" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="signup_ac.php">
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td colspan="3">[b]Sign up[/b]</td>
</tr>
<tr>
<td width="76">Name</td>
<td width="3">:</td>
<td width="305"><input name="name" type="text" id="name" size="30"></td>
</tr>
<tr>
<td>E-mail</td>
<td>:</td>
<td><input name="email" type="text" id="email" size="30"></td>
</tr>
<tr>
<td>password</td>
<td>:</td>
<td><input name="password" type="password" id="password" size="30"></td>
</tr>
<tr>
<td>Country</td>
<td>:</td>
<td><input name="country" type="text" id="country" size="30"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
<Html>
Codice PHP:
<?
include('config.php');
$tbl_name=members_db_temp;
$confirm_code=md5(uniqid(rand()));
$name=$_POST['name'];
$email=$_POST['email'];
$country=$_POST['country'];
$sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')";
$result=mysql_query($sql);
if($result){
$to=$email;
$subject="Your confirmation link here";
$header="from: mio sito";
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$message.="http://www.miosito.com/confirmation.php?passkey=$confirm_code";
$sentmail = mail($to,$subject,$message,$header);
}
else {
echo "Not found your email in our database";
}
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send Confirmation link to your e-mail address";
}
?>