I have the following code:
if($_POST['profileName']!="") {
$profileName = $_POST['profileName'];
if (!($stmt = $con->prepare("UPDATE `user_settings` SET ProfileName=?,ProfileSetup=? WHERE Username=?")) || !is_object($stmt)) {
die( "Error preparing: (" .$con->errno . ") " . $con->error);
}
$stmt->bind_param('sis', $profileName, 1, $_SESSION['user']);
if($stmt->execute()) {
echo '<div class="alert_successful alert_absolute_center">';
echo 'Profile Name change Successful!';
echo '</div>';
} else {
echo '<div class="alert_unsuccessful alert_absolute_center">';
echo 'Something went wrong... Try again!';
echo '</div>';
}
}
I would like to be able to redirect to different places depending on the result of the if statement... I have tried setting variables and then using a meta redirect, but of course that didn't work because it was looking for the variable before it was actually set...
Any help is much appreciated.
echo '<script>location="/test"</script>';