|
-
Jan 22nd, 2012, 06:33 AM
#1
Thread Starter
Junior Member
Login forms PHP
Hi,
Just a general question on PHP login forms:
I have a html login form(Form.html), which then sends the successful user to the next page (loginsuccess.php).
How can I prevent access to the loginsuccess.php page when typed in the address bar, like so- 'loginsuccess.php'? obviously by doing this its defeating the purposes of a login system.
Any help would be appreciated.
Thanks
Twitter @dancematt
Programmers unite
-
Jan 22nd, 2012, 05:18 PM
#2
Re: Login forms PHP
Logic of a login processing page should go something like (pseudo code):
Code:
if( login credential [such as a cookie] exists ){
continue to show page or other logged-in operation
}else{
if( form-submitted login values exist ){
if( login values are correct ){
give the user a login cookie; continue to show page or other logged-in operation
}else{
send the user to the login page (display "wrong username/pass" message)
}
}else{
send the user to the login page
}
}
-
Jan 23rd, 2012, 06:22 AM
#3
Thread Starter
Junior Member
Re: Login forms PHP
Brilliant, thanks.
Currently, I am using WAMP server to test my scripts.
I guess I need an actual web server to use cookies? or is WAMP sufficient?
Cheers
Twitter @dancematt
Programmers unite
-
Jan 23rd, 2012, 12:15 PM
#4
Re: Login forms PHP
WAMP should be sufficient.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|