SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Code

  1. #1
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Code

    what is the code to add on so the code below only takes place if they are logged in?

    PHP Code:
     if ($qry7['gguests'] == "n")
    {
    echo 
    "No";
    }
    else
    {
    echo 
    "Yes";


  2. #2
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  3. #3
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand your question...

    For me, I use $_SESSION when it comes to logged-in.

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in your script, how do you find out of someone is logged in?

    assuming you have a session variable named logged_in

    PHP Code:

    if ($_SESSION['logged_in'] == 'the value i use to indicate they are logged in') {
        
    // they are logged in, do something
    } else {
        
    // they are not logged in. do something else.


  5. #5
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i mean whats the code to make it something like this

    if ($row['perms'] == "sadmin" & $qry7['gguests'] == "n")
    {
    echo "No";
    }
    else
    {
    echo "Yes";
    }

  6. #6
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  7. #7
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nobody really is understanding your question.
    If you could please try to explain the situation a little bit more about what you are trying to do. What does your database structure look like? Where do you have them log into the system (enter there username & pass)?
    This info would help us alot in answering your question.

  8. #8
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,022
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    also, tidal wave, please note that bumping a thread is not permitted
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •