Jump to content


Photo

Send to a different page


  • Please log in to reply
4 replies to this topic

#1 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 28 August 2006 - 07:41 PM

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';
}
?>


#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 28 August 2006 - 07:46 PM

use a header:

header("location: user_level1.php");

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

#3 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 28 August 2006 - 07:50 PM

Eventually I will have about 8 different user levels. Can I just use HEADER to send them to the correct page?

#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 28 August 2006 - 07:54 PM

Yes.

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


#5 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 28 August 2006 - 10:48 PM

TYVM.
I must say this is by far the most useful and friendly forum I think I have ever been a part of.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users