Jump to content

Archived

This topic is now archived and is closed to further replies.

Greaser9780

Send to a different page

Recommended Posts

I am running a checkuser.php with my login system. How can I direct them to the properpage in my login_success.php. I believe I understand what to do I just don't know which command to use to send them to the proper user level page. This is what I have now that doesn't work. I don't think include is the right statement. Can anyone point me in the right direction?

<?
session_start();

include 'welcome.php';
   


if($_SESSION['user_level'] == 0){
    include 'user_level_0.html';
}
if($_SESSION['user_level'] == 1){
    include 'user_level1.php';
}
?>

Share this post


Link to post
Share on other sites
use a header:

[code]header("location: user_level1.php");[/code]

Or you can ouput a meta refresh tag to the browser, or a javascript redirect to the browser.

Share this post


Link to post
Share on other sites
Eventually I will have about 8 different user levels. Can I just use HEADER to send them to the correct page?

Share this post


Link to post
Share on other sites
Yes.

[code]if($_SESSION['user_level'] == 0){
    header("location: user_level_0.html");
}
if($_SESSION['user_level'] == 1){
    header("location: user_level1.php");
} [/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.