Forum Moderators: coopster
elseif ($action == "checkpassword")
{
$id = $_POST['update_link_id'];
$checkpassword = $_POST['update_link_password'];
//START
if(empty($checkpassword)){
$_SESSION['updatelinkstatus'] = "Invalid Password - Please Try Again<br><br>";
$_SESSION['allow_update_link_id'] = "";
$goback = "".$base_url."index.php?action=editlink&id=".$id."";
header("Location: $goback");
exit;
}
Is there a problem I am not seeing in the script here? The page stays on ...php?action=checkpassword and does not go to
"".$base_url."index.php?action=editlink&id=".$id."".
You cant output anything to the browser before the header. Which you are doing in that script in this bit
$_SESSION['updatelinkstatus'] = "Invalid Password - Please Try Again<br><br>";
$_SESSION['allow_update_link_id'] = "";
$goback = "".$base_url."index.php?action=editlink&id=".$id."";
header("Location: $goback");
header("Status: 301 Moved Permanently");
header("LOcation: " . $goback);
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.
You really should be sending an absolute URI, including scheme and host in that Location header. See more details on the header [php.net] manual page.