php - Redirect page when user is verified -
I have this code to verify if there is an administrator account to backoffice the user's website, but if the user Do not redirect the user to The verification code In this page, (header) I call this file to verify the session alert part before One more thing is that you should consider - these are security issues that raised the user from justifying the values of .. index.php . He lives in this page but no content is shown.
& lt ;? php $ user = isset ($ _ session ["Usuario"])? $ _SESSION ["Usuario"]: ''; $ Rank = release ($ _ session ['rank'])? $ _SESSION ['Rank']: ''; If ($ US! = '' & Amp; Rank == 'Administrator') {} else {resonates <
& lt ;? php session_start (); need_once "../config.php"; "verificar.php" is required;? & Gt; & lt; div id = "header" & gt; & lt; a href = "index_logged.php? Page = index "& lt; img src =" img / logo.png "& gt; & lt; / a & gt; & lt; / div & gt;
header ("location: ../index.php"); Stopping - if you want to redirect it, you
die (); or
exit;
location header
location because the browser will first redirect the user, able to see the alert And it is also forbidden to call the
header function after you send something for the output (for example, as you did with
echo ]
$ _ session / $ _ session has a better way of keeping some tokens and saving the user's position in the database - in this way, you can change your position directly with DB depending on session / changing code Without doing
Comments
Post a Comment