<?php
include "connect.php";
$nama = $_POST['nama'];
$password = $_POST['password'];
$message = "Your data is not in our database! check for mistake";
$sql = "select * from tbuser where nama = '$nama' and pass = '$password'";
$query = mysqli_query($con,$sql) or die("error $sql");
$num = mysqli_num_rows($query);
$result = mysqli_fetch_array($query);
if($num==1){
header("location: home.php");
}
else{
echo "<script type='text/javascript'>alert('$message');</script>";
}
?>
so after the message is sent, I want it to come back to the index.php. I tried to use header("location:index.php") but it didn't work.