Monday, 20 March 2017

php - Include redirection in the Body




I have the problem in the header(). I know that it has to be before any html code, but with that to replace it so that it redirects to another url.




this is code (index.php):





title

$count = 1;
if ($count > 0) {

header("Location:list.php?incluided");
} else {
header("Location:list.php?error");
}
?>




How can I replace it?. Thanks.




The solution, add javascript and delete header():





title

$count = 1;
if ($count > 0) {

print '

Answer



$count = 1;
if ($count > 0)
header("Location:list.php?incluided");
else
header("Location:list.php?error");
die();

?>


title





Just put your redirection code on top.



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...