|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
i know alot of people are wondering on how to make a password protected members area. here's a login script that you can use to verify a user's username & password against the database. it was derived from many other scripts. i have removed some parts like setting cookies... etc. enjoy
PHP Code:
hope the copy & paste worked right. if it doesnt work tell me, i probably pasted something wrong. ![]()
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#2
|
|||
|
|||
|
Nice
You don't need the line 'global $HTTP_POST_VARS;', thoughand instead of having the multiline if structure at the end of the array, you could use this type of conditional PHP Code:
At least I think that's nicer ![]() oh, and after the header() functions, you might want to exit;.. because I think it's possible to for example write a client that ignores Location headers I found an error in this line: (I'm guessing that error got in while making it ready for posting) header("Location: <a href="http://url.com" target="_blank">http://url.com</a>"); change it to header('Location: <a href="http://url.com" target="_blank">http://url.com</a>'); or header("Location: <a href=\"http://url.com\" target=\"_blank\">http://url.com</a>"); (I prefer the first one)
__________________
Best Regards, Håvard Lindset |
|
#3
|
|||
|
|||
|
Just a question -> why are you using '$HTTP_POST_VARS' which is now depreciated?
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#4
|
|||
|
|||
|
please guys don't bash me but how does this exactly work. i want to know exactly what does this script do.
again don't bash me... ![]()
__________________
Apache Expert |
|
#5
|
|||
|
|||
|
Quote:
he's not actually using it, he's just declaring it as a global variable.. as I pointed out in the post above ![]() btw, what's that xuldeveloper going to be? ![]() |
|
#6
|
|||
|
|||
|
Quote:
Well, thats pretty much what I meant - why is it in his code as that syntax when it is depreciated - sorry, should of asked the question as that....... |
|
#7
|
|||
|
|||
|
Quote:
my server is weird. if use $_POST without declaring $HTTP_POST_VARS global it won't work. as for the header error, yes it was an error i think dreamweaver automatically changed it into html format. it's originally: header("Location: http://url.com"); |
|
#8
|
|||
|
|||
|
Im currently writing a 6 part series on creating a members area, make sure to keep an eye out for it, its going to be huge
|
|
#9
|
|||
|
|||
|
Quote:
yeah, that is weird.. $_POST is a "superglobal" array, and should be available in all scopes |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > my login script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|