So I got data entry that ends with a header to a location (index.php), wanted to set a var $successMsg = "Good";
and to display it on the index.php page.
if (mysqli_query($conn, $insertData)) {
$successMsg = "Good";
header("Location: ../index.php?success");
} else {
header("Location: ../index.php?failed");
}
mysqli_close($conn);
That way on index.php it will echo $successMsg