PHP - Need help

Waflix

El Psy Congroo
OP
Member
Joined
Dec 17, 2010
Messages
638
Trophies
1
XP
275
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
ÂÂÂÂÂÂÂÂÂÂÂÂ
 
D

Deleted_171835

Guest
You need to initialize the session first by calling,
Code:
session_start()
1
 

Waflix

El Psy Congroo
OP
Member
Joined
Dec 17, 2010
Messages
638
Trophies
1
XP
275
Country
Netherlands
^
^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.
 

Issac

Iᔕᔕᗩᑕ
Supervisor
Joined
Apr 10, 2004
Messages
7,025
Trophies
3
Location
Sweden
XP
7,344
Country
Sweden
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
 

Waflix

El Psy Congroo
OP
Member
Joined
Dec 17, 2010
Messages
638
Trophies
1
XP
275
Country
Netherlands
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

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Were actually bots