i try but failed to send...the coding in the another page not in the same page of form...this is my coding...
else{
if(isset($_POST['Button']))
{
$subject = "Tempahan Telah Dibuat";
$text = "Tempahan Telah dibuat oleh $idpengguna.";
mail("rahaiffi@yahoo.com", $subject, $text);
}
$tarikhprj = "$tarikhprj";
$w = explode('/', $tarikhprj);
$tarikh = date("d-m-Y",time());
$day = date("d",time());
$month = date("m",time());
$year = date("Y",time());
$masa = date("H:i:s",time());
$query = "INSERT INTO mohon VALUES ('','$idpengguna','Belum Disahkan','$nama','$bahagian','$masa','$tarikh','$day','$month','$year','$namapengguna','$bil','$tujuan',
'$w[0]','$w[1]','$w[2]','$destinasi','$jam','$minit','$waktu','$jam2','$minit2','$waktu2')";
$result = mysql_db_query($dbname,$query);
if($result) {
header("Location:papar2.php?idpengguna=$idpengguna");
}
}
}
i want an email send when data insert into the database....