SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question "and if" statement

    Basically im creating a login routine but are looking for two conditions for the else stament.

    I have my user table and want it to references user_id and user_condition

    Is there and "And If" statement to create this

    if (tep_session_is_registered('user_id'))
    andif user_condition=10
    require(DIR_DS_BOXES . 'user_functions.php');
    else
    require(DIR_DS_BOXES . 'user_login.php');

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is a very basic subject. If you can't do an AND in an if() statement, you should go back to the beginner tutorials.

    PHP Code:
    if (isset($_SESSION['user_id']) && $_SESSION['user_condition'] == 10){
        require(
    DIR_DS_BOXES 'user_functions.php');
    }else{
        require(
    DIR_DS_BOXES 'user_login.php');

    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Zealot evilunix's Avatar
    Join Date
    Jun 2008
    Location
    York, UK.
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do we need to be so patronising though?

    Sometimes the most basic things are the easiest to get stuck with

  4. #4
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Do we need to be so patronising though?
    Meh, I go for the less subtle approach - it tends to work very well too.
    It is, after all, basic PHP.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  5. #5
    SitePoint Zealot evilunix's Avatar
    Join Date
    Jun 2008
    Location
    York, UK.
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    true that. guess it wouldn't have hurt to have read a tutorial or two before asking a question like this!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •