Search code examples
phpmysqlhttp-redirectauthenticationmember

how do I redirect my php login to a higher folder?


I have a script in website.com/login/, it contains all the files and forms need to proccess user authentication and contains the forms as well. I have the main login form on my main index, website.com/index.php. I have successfully directed the form to post /login/login-exec.php, but once the script has run it redirects to /login/login-success.php, not website.com/index.php?od=logsucc. How would i go about telling the login-exec.php to redirect to the main folder of the website instead of /login/?


Solution

  • use

    header( 'Location: /index.php?od=logsucc' );
    

    the leading / says go back to the site root directory.