I am trying to redirect users to a different page using the Header function in PHP like so but it doesn’t work:
Header("Location: " . VIEW_PATH. "/somePage.html");
VIEW_PATH is defined in my config.php like this:
define(‘VIEW_PATH’, DIR.”\View”);
The Header function is currently in my Auth Class in my Controller Folder and I am trying to redirect users to a page in my View folder.
This works but I want to make use of VIEW_PATH:
Header(“Location: ../View/somePage.html”);
As i can see, your VIEW_PATH constant contains physical path on server. But you should use url path to file in your header call.
Look at this example.
P.S.
Also you should use / in your url, not \