28, May 2012

question regarding user login checking - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: question regarding user login checking
« previous next »
Pages: [1] Print

Author Topic: question regarding user login checking  (Read 1536 times)
Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« on: Sep 11, 2006, 08:47:00 am »

Right now I'm having a difficult time seeing how to simply see if a user is logged in or not, and if so, what level they are. Some psuedo code:
Code:
if ( is_logged_in() ) {
    echo their access level, or whatever
} else {
    echo information for non users
}
The above task seems difficult because it appears access_page() is required to get the login information but it also requires them to be logged in. So, it instantly redirects to the login when I do not want this. Please provide code that does the above but with no redirects.

Is disabling login redirects the way to solve this, and if so, what's the official way to do that?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 11, 2006, 09:58:30 am »

waht about:
Code:
<?php
if (!empty($_SESSION['user'])) {
  echo 
$_SESSION['user'];
} else {
  echo 
"public content";
}

Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« Reply #2 on: Sep 11, 2006, 06:44:16 pm »

Ah yes, thanks. It appears I was overcomplicating matters Smiley
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4032
Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: question regarding user login checking
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 04:24:53 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.