I've tried the absolute path and it didn't work either. The only thing echoed to the browser is "Your profile has been updated." The funny thing is, I have the exact same redirect after a new user logs in and it redirects perfectly fine.
<?php
if ($username && $passwd) {
include("usersdb.php");
$Login_Query = "SELECT Nick, Password FROM $TableName where Nick='$username'and Password='$passwd'";
$Login_Result = mysql_db_query($DBName, $Login_Query, $Link) or die ("Couldn't execute query.".mysql_error());
while ($row = mysql_fetch_array($Login_Result)) {
$Username_Test = $row['Nick'];
$Password_Test = $row['Password'];}
$encpasswd = base64_encode($passwd);
if ($Username_Test == $username && $Password_Test == $passwd) {
setcookie('cookiename', $username, time() + 864000, "/");
setcookie('cookiepass', $encpasswd, time() + 864000, "/");
header("Location: ../pages/portal.php");
print("<html><title>Login</title><head>Login</head><body>");
print ("$Everything is okay");}
else {
print("There is no record of your registration!");}}
else {
print ("Error has occured");}
?>