28, May 2012

Logout Not Working - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Logout Not Working
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Logout Not Working  (Read 663 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Jan 10, 2011, 10:10:33 pm »

Trying to log out and I get this error:
Fatal error: Call to a member function logout() on a non-object in /home/primeran/public_html/controller.php on line 112


Here is some code
Code:
Switch ($page) {
?  ? case "login":

?  ?  ?  ? if ($_SERVER['REQUEST_METHOD'] == "POST") {
?  ?  ?  ?  ?  ? //die('made it');
?  ?  ?  ?  ?  ? $user = New userAccount($db, $DBSETTINGS);

?  ?  ?  ?  ?  ? // Check login
?  ?  ?  ?  ?  ? if (!$user->login($_POST['username'], $_POST['password'])) {
?  ?  ?  ?  ?  ?  ?  ? $message = 'Login is incorrect';
?  ?  ?  ?  ?  ? }
?  ?  ?  ?  ?  ? // Check Account Active
?  ?  ?  ?  ?  ? if (!$user->is_active()) {
?  ?  ?  ?  ?  ?  ?  ? $message = 'Your account is not active';
?  ?  ?  ?  ?  ? }
?  ?  ?  ? }

?  ?  ?  ? //var_dump($user);die();
?  ?  ?  ? if (!$user) {
?  ?  ?  ?  ?  ? $pagetitle = 'Account Access Login';
?  ?  ?  ?  ?  ? $pagebody = 'components/account/login.php';
?  ?  ?  ? } else {
?  ?  ?  ?  ?  ? redirect('account');
?  ?  ?  ? }
?  ?  ?  ? break;

?  ? case "logout":
?  ?  ?  ? $user->logout(_ROOTURL_);
?  ?  ?  ? break;
}



What am I doing wrong here???
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #1 on: Jan 10, 2011, 10:12:22 pm »

Sry had tabs in pasted text

Should read

Code:
?  ?  case "login":

?  ?  ?  ?  if ($_SERVER['REQUEST_METHOD'] == "POST") {
?  ?  ?  ?  ?  ?  //die('made it');
?  ?  ?  ?  ?  ?  $user = New userAccount($db, $DBSETTINGS);

?  ?  ?  ?  ?  ?  // Check login
?  ?  ?  ?  ?  ?  if (!$user->login($_POST['username'], $_POST['password'])) {
?  ?  ?  ?  ?  ?  ?  ?  $message = 'Login is incorrect';
?  ?  ?  ?  ?  ?  }
?  ?  ?  ?  ?  ?  // Check Account Active
?  ?  ?  ?  ?  ?  if (!$user->is_active()) {
?  ?  ?  ?  ?  ?  ?  ?  $message = 'Your account is not active';
?  ?  ?  ?  ?  ?  }
?  ?  ?  ?  }

?  ?  ?  ?  //var_dump($user);die();
?  ?  ?  ?  if (!$user) {
?  ?  ?  ?  ?  ?  $pagetitle = 'Account Access Login';
?  ?  ?  ?  ?  ?  $pagebody = 'components/account/login.php';
?  ?  ?  ?  } else {
?  ?  ?  ?  ?  ?  redirect('account');
?  ?  ?  ?  }
?  ?  ?  ?  break;

?  ?  case "logout":
?  ?  ?  ?  $user->logout($Url);
?  ?  ?  ?  break;
Where are my glasses?
*
Posts: 23
138 credits
Members referred : 0


« Reply #2 on: Jan 31, 2011, 05:12:17 pm »

Can't read your code, I think there are many newline characters in it. Please copy it from a proper text editor.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=11137
Tags : php userclass Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Logout Not Working
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:50:42 am





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!


Forum Statistics
Total Posts: 62.814
Total Topics: 11.028
Total Members: 21.451
Tutorials : 58
Resources : 929
Designs : 395
Latest Member: sobbin

102 Guests, 2 Users online :

10 users online today:




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.