I want to pass a variable to a page, but cannot modify header... is always in the way
if(isset($_POST['send']))
{
$sender = $_SESSION['Email'];
$receiver = $_POST['email'];
$message = $_POST['textmessages'];
$date = date("Y-m-d h:i:sa");
$q = 'INSERT INTO `tblmessage`(`id`,`sender_name`,`receiver_name`,`message_text`,`date_time`,`userid`)
VALUES("","'.$sender.'","'.$receiver.'","'.$message.'","'.$date.'","'.$user_id.'")';
$r = mysqli_query($con, $q);
if($r)
{
header("location.href='messages.php?user=".$receiver);
}
else
{
echo $q;
}
}
I tried passing the user to the page, but:
output started at C:\xampp\htdocs\MBPH(Beta)\messages.php:79) in `C:\xampp\htdocs\MBPH(Beta)\newmessage.php on line 38
always pops up, that line 38 is
'header("location.href='messages.php?user=".$receiver);'