User System outside of SMF

Started by mischievousx3, February 24, 2011, 06:22:00 PM

Previous topic - Next topic

mischievousx3

I'm kinda new to this and I need help with one of the manuals. I want a login form on my homepage and I've tried to follow the manual and I get a php error.

I don't know if I'm placing ssi.php include in the right place. I'm also using this one:

$_SESSION['login_url'] = 'yoursite' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
$_SESSION['logout_url'] = 'yoursite' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];

because I'm using a query string
  • . It says to place it before the <html> tag (in my index.php), but I ended up with an error =x

    Any help would be appreciated. Thank you.

Arantor

What's the index.php file you're trying to add it into? Might just be easier if you attached that file here so we can see it...

Arantor

I was kind of hoping you'd either post it inside a code tag, or better, attach the actual file here.

mischievousx3


Arantor

You don't need to set the login URL, that will be set when someone logs into the forum anyway (unless for some special reason you *really* need the query-string, but unless you already have some code in place to handle it, it's sort of pointless anyway)

Same for the logout URL really, you don't need to specify the querystring from the page they logged in at unless you really, really need it and if someone logs out, they don't normally need it, and can just be set to $_SESSION['logout_url'] = 'http://www.allmerk-noplay.com/index.php';

So, what error do you get, exactly?

mischievousx3

Wait. I got it. Lol. I was trying to give you the file where I wanted the code to be, I refreshed it and there it was.

I ended up using
<?php
require_once('/path/to/forum/SSI.php');
$_SESSION['login_url'] = 'http://yoursite.com' . $_SERVER['PHP_SELF'];
$_SESSION['logout_url'] = 'http://yoursite.com' . $_SERVER['PHP_SELF'];
?>


Oh, is there anyway I can customize the form ? >.<

Thanks for trying to help me. Really appreciate it.

Arantor

Depends on what you mean by 'customize' it. The form is output by ssi_login() in SSI.php. If that's not sufficient customisation (i.e. through CSS), I'd suggest you implement your own form copying the underlying structure from that function - any modifications to SSI.php will be wiped out when you upgrade.

mischievousx3

I was able to customize it through ssi.php. Thank you so much :)

Arantor

Quote from: mischievousx3 on February 24, 2011, 09:28:12 PM
I was able to customize it through ssi.php. Thank you so much :)

Now you have to remember to recustomise it when you upgrade to final.

Advertisement: