PHP - Need help

  • Thread starter Thread starter Waflix
  • Start date Start date
  • Views Views 1,349
  • Replies Replies 7

Waflix

El Psy Congroo
Member
Joined
Dec 17, 2010
Messages
638
Reaction score
1
Trophies
1
XP
305
Country
Netherlands
I've been writing my site for a few days now, but my register and login system doesn't seem to work.
The problem is that logging out doesn't work. When you click 'logout' you stay logged in!

My system is based on a Dutch tutorial (click here) and I've made some adjustments so you can login at the homepage, and once you've been logged in, you will see a welcome message instead of the login form.
My site can be found here: just click here.

I don't think the problem is that you don't log out, but that it still displays the welcome message, even when you are already logged in.
CODE// logout.php


CODE// login.php


ÂÂÂÂ
ÂÂÂÂÂÂÂÂBlanco [Martijn]
ÂÂÂÂÂÂÂÂ
ÂÂÂÂ
ÂÂÂÂ
ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂLogin
ÂÂÂÂÂÂÂÂÂÂÂÂ
 
You need to initialize the session first by calling,
Code:
session_start()
1
 
^
^If you mean I should add that code to 'logout.php', then I get this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 2[/p]

^ And, Issac, I deleted it succesfully, but it didn't solve the problem stated earlier in this post. But it was indeed unnecessary code.
 
Ah, Checked a bit more now... It is like SoulSnatcher says... in a way...

In the tutorial they change page, and exit the if-statement after they destroyed the session. You destroy it and then continue with the next..
There, you'd have to start the session again i believe.

EDIT: Wrote that before SoulSnatchers new response... What he say is probably better!
smile.gif
 
The Syntax error is gone, but now the only problem is that there is a small mistake in the code, like a missing . ) ; ' or }
Gone!

And now it's always displaying "You didn't fill in a name!" because it doesn't know if you've already submitted the form or not. :')
Gone! --> It is now completely working; yay!
 

Site & Scene News

Popular threads in this forum