PHP Tutorial: Professional Login System v2 (Part 3)
Loading...
9,551
Loading...
Uploader Comments (phpclass)
see all
All Comments (53)
-
i was wondering that too.......
-
while ERROR like this
Warning: Invalid argument supplied for foreach() in class.login.php on line xxx
-
how do you log out?
-
I downloaded the example and is not working.
-
i see all the videos bt in end i got result
"Forbidden You don't have permission to access /user(its folder name)/< on this server."
so wht's the problem.
i see the videos again and again but show again same error. totaly confuss.
Loading...
I find a bug into your class.login.php. if you use a development server and enabled the php errors and warnings you will get a undefined token error. Because in the constructor you define the token : $this->_token = $_POST['token']; So if your creating a new file and initialise the login class you will get the post error because it's not existing var... so what I did to fix this little bug is change the token definition to :
$this->_token = isset($_POST['token']);
domentarion 1 week ago
@domentarion Thank you for the comment. I think you might have misunderstood what the POST variable token does. The POST token variable is a randomly generated value used to validate if a form submission is unique during the current session. Your code suggestion only checks if any token value has been submitted. You actually need to generate a unique value during the current session and then validate that it came from the same session.
phpclass 1 week ago
@domentarion $this->_token = isset($_POST['token']); actually gives you a TRUE or FALSE value. This is flawed because I can easily submit data from a form on another domain and your code will accept it. The code that I put for download didn't have any bugs when I tested it. So it should be fine. Let me know if you still have trouble. Thanks.
phpclass 1 week ago
@domentarion Try using this line of code
$this->_token = isset($_POST['token'])? $_POST['token'] : 0;
phpclass 1 week ago
when i try to login PHP_SELF is not working. what seems to be the problem??
karasyiannis 1 year ago
Can you give me more details about your problem. This script should be working properly.
phpclass 1 year ago