php - redirection to another page in wordpress -


I am trying to redirect the user page, once I enter the login id and the password, I will type the code like this.

  & lt ?? Includes Php ('... / database.php'); If (isset ($ _ POST ['formubmitted'])) // Start a session: session_start (); $ error = array (); // This array will store all error messages (empty ($ _ POST ['empno'])) // If email is supplied then empty $ error [] = 'You have not forgotten to enter your employee '; } And {$ email = $ _POST ['empno']; } If (empty ($ _ POST ['password'])) {$ error [] = 'Please enter your password'; } And {$ password = $ _POST ['password']; } If (empty ($ error)) // If the array is empty, it means no error was found {$ query_check_credentials = "SELECT * from table WHERE (emp_no = '$ email' and password = '$ password')"; $ Result_check_credentials = mysqli_query ($ dbc, $ query_check_credentials); If (! $ Result_check_credentials) {// If the query failed the echo 'query failed'; } If (@mysqli_num_rows ($ result_check_credentials) == 1) // If the query is successful {// was a match if (! ($ _ SESSION [ 'user'])) {$ _SESSION = mysqli_fetch_array ($ result_check_credentials, MYSQLI_ASSOC); // Assign this query to the session global variable title ("Location: http://websiteaddress.com). / Folder / page_id = 800"); } And {$ msg_error = 'either your account is inactive or the email address / password is incorrect'; }} Else {echo '& lt; div class = "errormsgbox" & gt; & Lt; ol & gt; '; Forex currency ($ error as $ key = & gt; $ value) {echo '& lt; Li & gt; '. $ Value '& Lt; / Li & gt; '; } Echo & lt; / ol & gt; & Lt; / Div & gt; '; } if (isset ($ msg_error)) {echo '& lt; div class = "warning" & gt; '. $ msg_error '& Lt; / Div & gt; '; } /// var_dump ($ error); mysqli_close ($ DBC); } // main conditional deposit. ? & Gt; Please enter your employee ID and password to sign in (both are case-sensitive). & Lt; form action = "" method = "post" class = "registration_form" & gt; & Lt; Fieldset & gt; & Lt; Legend & gt; Admission form & lt; / Legend & gt; & Lt; P & gt; & Lt; / P & gt; & Lt; Div class = "element" & gt; & Lt; Label = "name" & gt; Employee Number: & lt; / Label & gt; & Lt; Input type = "text" id = "e-mail" name = "empno" size = "25" /> & Lt; / Div & gt; & Lt; Div class = "element" & gt; & Lt; Label = "password" & gt; Password: & lt; / Label & gt; & Lt; Input type = "password" id = "password" name = "password" size = "25" /> & Lt; / Div & gt; & Lt; div class = "submit" & gt; & Lt; Input type = "hidden" name = "formulated" value = "true" /> & Lt; Input type = "submit" value = "login" /> & Lt; / Div & gt; & Lt; / Fieldset & gt; & Lt; / Form & gt;   

I can not go to my user page. Every time I enter the login button, my page was re-logged to the same URL .e login page

Try to change the situation,

  if (isset ($ _ session) [] 'user')) instead of {  

,

  if (! isset ($ _ sESSION [ 'user'])) {   

Hope this is a problem.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -