News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

login PHP

Started by MrLeN, December 16, 2012, 04:01:12 AM

Previous topic - Next topic

MrLeN

I am building a website using stuff from ssi_examples.php

There's one that says:


<?php ssi_logout(); ?>


but I want to make:


if (isset(MemberLoggedIn)) {
  ssi_logout();
}
else {
  echo '<a href="index.php?action=login">Login</a>';
}



What can I put in place of MemberLoggedIn?

Or, if that is no good -- how else can I replace the logout link with a login link?

Colin

!$context['user']['is_guest']


and remember to define context as a global variable.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

MrLeN

I don't know what a global variable is or how to "define" it  :o

emanuele

<?php
global $user_info;

if (
$user_info['is_guest'])
    
ssi_login();
else
    
ssi_logout();


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrLeN


Advertisement: