PHP login, redirect, logout script

Hi guys

I’ve been follwing so many tutorials on how to do a simple login, redirect once logged in and logout script but to be honest none of them seem to be valid (lots of syntax errors.

I’ve setup wamp and dweaver succesfully and written the code just like they have but I keep getting fatal errors when i try to practice the login on a firefox page.

Can anyone point me in the right direction on a decent tutorial on how to do this. Vids would be great

If not any advice would be much appreciated, PHP is confusing the backside off me

Thanks guys

It might be a little long in the tooth but http://articles.sitepoint.com/article/anthology-2-1-access-control covers the basics of access control.
Its from 2004 but should give you a startpoint.

thanks man…

oops forgot to add a quick question.

Its slightly off topic but just wanted to know is it as easy replacing if statements with switch ones instead…?

I’ve learnt they both do exactly the same thing (not sure if that’s completely correct), are there any advantages/disadvantages to using either…?

As they both do the same thing it is quite easy. Its a personal thing really but I do find long switches easier to read quickly than trying to find matching braces :slight_smile:

Yeh I think I’ll probably go for the switch way aswell.

Does this mean no need for if, else-if etc…or will they still be used in other ways…?