hi everybody
this project my graduate project pls help me .. i dont understand where is error and how to sending mail ?
mr.php-------------
<html>
<body>
<table width="380" border="0" cellpadding="3" cellspacing="1" >
<tr>
<td width="33%"><strong>Enter your email : </strong></td>
<td width="67%"><form name="form1" method="post" action="mm.php">
<input name="email_to" type="text" id="mail_to" size="25">
<input type="submit" name="Submit" value="Submit">
</form>
</td>
</tr>
</table>
</body>
</html>
mm---------
<?php
include("config.php");
include("fk.php");
$email = $_POST['email'];
if(!$email)
{
echo "enter your mail ";
include ("mr.php");
exit();
}
$email_kntrl = mysql_query("SELECT * FROM users where email in('".$email."')");
$email_kntrl2 = mysql_num_rows($email_kntrl);
if($email_kntrl2 == 0)
{
echo '<font color="red">havent this mail </font>';
unset($email);
include ("mm.php");
exit();
}
$new_password = sha1($random_pass);
$sql = mysql_query("update users set sifre='$new_password' where mail='$email'");
$konu = "Yeni Şifreniz:";
$mesaj = "your new password $random_pass;
mail();//
echo 'we sending ';
?>
config.php------------
<?php
$host = "localhost";
$username = "root";
$password= "";
$db_name="petdb";
// Databasemize baglaniyoruz
@mysql_connect("$host", "$username", "$password");
@mysql_select_db("$db_name")or die("");
if(mysql_errno())
{
echo 'Veritabanina baglanilamiyor ...';
exit;
}
?>
fk.php-----------
<?php $salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$random_pass = $random_pass . $tmp;
$i++;
}
?>