By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

Check if user is logged in in vSigup

uranuskid
P: 19
Hey folks,

I was hoping someone could help me out with following problem:
I want to use vSigup (available free at www.beanbug.net/vScripts.php) to manage protected pages.

Well, that all works fine, however, I'd like to include a conditional clause on public pages where either a loginform is displayed or a Welcome user statement. The script works with cookies rather than a session, so I tried to check the cookie without succes

What I did was:
[PHP]If (isset($COOKIE['USERNAME'])&&(isset$COOKIE['PASSWORD'])) {

$USERNAME = $_COOKIE['USERNAME'];
$PASSWORD = $_COOKIE['PASSWORD'];

$CheckSecurity = new auth();
$check = $CheckSecurity->page_check($USERNAME, $PASSWORD);
}
else
{
$check = false;
}

if ($check == false)
{<!-- Print the login script -->}
else { print "Welcome $USERNAME;}
[/PHP]

I redirected the resultpage of the loginprocess to the index page where the loginform is. When I login I wont get the Welcome message but again the loginform.

So, does anyone have experience with vSignup and might be able to give me a clue how I can realize above mentioned issue.

Kind regards

Frank
Apr 29 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 136
Hi,

I havent worked with vSignup but I am very much familier with secure login system that works with cookies.

firstly in our code If (isset($COOKIE['USERNAME'])&&(isset$COOKIE['PASSWORD'])) {, there should be $_COOKIE. Now the way u r collecting the USERNAME and PASSWORD from cookie may not be proper. Try to echo $COOKIE['USERNAME'] if u r getting it properly or not.

If its ok then try to check what is returned by the function page_check().

I think this way u can catch the error easily.

susen
Apr 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.