sgs Posted February 19, 2015 Author Posted February 19, 2015 Ok, can you tell me that, exactly where is the problem? I mean Line number or something like these. Here is my validate_login.php file:Source file: http://www.sgpaste.tk/src/validate_login.phpOriginal file: http://www.sgpaste.tk/includes/validate_login.phpBut, I've to keep thesetcookie()andheader() function.
yashrs Posted February 19, 2015 Posted February 19, 2015 First of all in validate_login.phpon line 12 there is a blank line which should not be there.$ppwd = $_POST['sgp_pwd']; ?>//line 11// //line 12// <?php //line13// if (!empty($pusr) && !empty($ppwd)) { should be $ppwd = $_POST['sgp_pwd'];//removed the blank line and ?> and <?php if (!empty($pusr) && !empty($ppwd)) { because it would output a empty line which wouldn't allow the setcookie function in validate_login.php 1
sgs Posted February 19, 2015 Author Posted February 19, 2015 I've done it and the script now works but, I'm still getting the warning in beside of the checkbox And I think the setcookie() function is not working.
yashrs Posted February 19, 2015 Posted February 19, 2015 The session_start() and setcookie() functions should be in the starting of the index.php.Also, update all the source files in the /src folder with all the changes so that I know where exactly the problem is.
sgs Posted February 19, 2015 Author Posted February 19, 2015 Ok, I've updated all files in /src directory, now all the files are in the /src directory are included with my project.Check it here: http://www.sgpaste.tk/src/and fix my problem...And my project includes following files:a.i) login.php (only html form/page1)a.ii) validate_login.php (for validation)a.iii) functions.php (functions used in login.php and validate_login.php)a.iii) login.func.php (function used in login.php)b.) mpanel.php (members area/page2) first of all user goes to "login.php" and enters his/her login details then, the "validate_login.php" validates/checks if the details are exists in database. If matches then, if the use has checked the 'Automatic Login' (checkbox) then, the "validate_login.php" sets cookies for username, password & autologin and redirects the user to "mpanel.php", or if 'Automatic Login' (checkbox) has not checked then, the "validate_login.php" deletes the cookies, registers session for username & password and redirects the user to "mpanel.php".
sgs Posted February 19, 2015 Author Posted February 19, 2015 Can you tell me, are my all codes are write for the project? And I've updated the source files in /src directory you can check them here (all files in the /src directory are included with my project):http://www.sgpaste.tk/src/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now