php - header() method doesn't work -
i want make redirect doesn't come back. know before header() method shouldn't call output result don't know have written methods returns output. source:
<?php include 'database.php'; $message = mysqli_real_escape_string($con, $_post['message']); date_default_timezone_set('iran'); $time = date('h:i:s a',time()); if(!isset($message) || $message == ''){ $error = "fill textbox";
header("location: harf.php?error=".urlencode($error));//changed
exit(); } else { $query = "insert main (user,message,time) values('robot','$message','$time')"; if (!mysqli_query($con,$query)) {
die('error: '.mysqli_error($con));//changed
} else { header("location: harf.php"); exit(); } }?>
thanks
you have spelling mistake here
header("locaton: harf.php?error=".urlencode($error));
change this
header("location: harf.php?error=".urlencode($error));
Comments
Post a Comment