|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Logins
Hi I make alot of login scripts for scripts i make and usually the user is sent to a the loggedin page and the loggedin page checks the database for the session and user status to check if the user is authenticated. I have heard that forwarding the user to a different page isnt the best way can anyone suggest a better way?
|
|
#2
|
||||
|
||||
|
RE: Logins
Here is an example of what i normally use.
// Database connection and query above this. If($num !=0){ header("location:loggedin.php"); setcookie($username, $pw); }else{ Exit; } Thats only a snippet but thats what i normally do. |
|
#3
|
|||
|
|||
|
RE: Logins
[moved to theory]
|
|
#4
|
|||
|
|||
|
RE: Logins
A lot of sites do it that way (login "splash page"). Any kind of online application generally does it, like hotmail, any online mail service really. I dont think there is really a cut and dry way to do it. My preffered way is to build an authentication script to check and see if the user has logged on, then build the page from there. If they arent logged on, build the login box, if they are, build the box with "logged in" options. Either way, your dealing with sessions. If you dont mind letting the users see some things on the site without being authenticated, this is fine. If you have a site totally closed off, in which everything is written to be viewed by "members only" then the splash page is the preffered way to go I think.
|
|
#5
|
||||
|
||||
|
RE: Logins
ok im using a template system to format the pages would an include function be advisable eg if logged in included loggedin.php which has a little authentication script at the top. If not logged in include login.php and stop current script? Or is it up to scripters preferance.
|
|
#6
|
|||
|
|||
|
RE: Logins
invoking an include is my preffered method.
|
|
#7
|
||||
|
||||
|
RE: Logins
depending on the scale of the application. If it's only a few pages then I'll do the authentication in the actual page.
If I have the form values being passed off to a seperate script for validation then I just use headers to redirect the user to the appropriate page immediately. I avoid the "You're now logged in" splash pages because I find them annoying. |
|
#8
|
||||
|
||||
|
RE: Logins
Splash screens in general are annoying they where king of websites when the internet first came out and aparently today 45% of people who see a splash screen dont hit enter they just click close on their browser according to a recent survey (i found out in a internet magasine)
|
|
#9
|
|||
|
|||
|
RE: Logins
Thats why ya only use them for people who need to get behind it for information.
|
|
#10
|
||||
|
||||
|
RE: Logins
True the things i hate are these fancy flash navigation bars that play a short movie of sound effects and graphics fading in and out before the nav buttons load. I mean i dont want to sit there watching some set of graphics fading in and out for the good of my health. I want to use the site.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Logins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|