I have created one login form and it is redirecting to validatelogin.php and validation happened.
<tr>
<td>Username / Email</td>
<td><input name="usr_email" type="text" class="required" id="txtbox" size="25"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="pwd" type="password" class="required password" id="txtbox" size="25"></td>
</tr>
<tr>
<td colspan="2"> <div align="center">
<input name="doLogin" type="submit" id="doLogin3" class="styled-button-1" value="Login" />
myvalidate.php is :
if(empty($err)){
header("Location: index.php?Page=defaultblog");
}
else
{
$err[] = "Invalid Login. Please try again with correct user email and password.";
}
} else {
$err[] = "Error - Invalid login. No such user exists";
}
}
In local machine , if no error it redirect to header("Location: index.php?Page=defaultblog");
but when i upload it inot server it only redirect to validate.php
Please tell me?
if(empty($err)){
echo '<meta http=equiv="refresh" content="1;url=index.php?Page=defaultblog">';
}
else
{
$err[] = "Invalid Login. Please try again with correct user email and password.";
}
} else {
$err[] = "Error - Invalid login. No such user exists";
}
Add the following lines to the top of the php code somewhere as I don't think your redirect is being called.
error_reporting(E_ALL);
ini_set('display_errors', 'On');
The key issue will probably be having a space or blank line somewhere before this code which prevents the redirect firing. Once resolved, reset the error reporting if required.