Jump to content

Recommended Posts

Posted

First of all in

validate_login.php

on 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

  • Like 1
Posted

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.

Posted

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.

Posted

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".

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...