How to make use of autologin in PBNL script

C0py this to moduls/func.php


if (isset($_COOKIE["username"]) && isset($_COOKIE["password"]) && !isset($_SESSION["user"]))
{
$cuser = $_COOKIE["username"];
$cpass = $_COOKIE["password"];
$check = mysql_num_rows(mysql_query("SELECT `username` FROM `b_users` WHERE `username` = '$cuser' AND `password` = '$cpass'"));
if ($check > 0)
{
$_SESSION["user"] = $cuser;
} else {
setcookie("username", "", time()-86400);
setcookie("password", "", time()-86400);
}

}


put it after <?php

after that


Then open /loguser.php, look for $_SESSION["user"]=$username;. under it, paste this code.

$CookieExpire = 200; //The number of days after which the cookie would expire.
$time = 60 * 60 * 24 * $CookieExpire;
$time = time() + $time;
setcookie("username", "$username", "$time");
setcookie("password", "$password", "$time");

change $CookieExpire to the number of your days the cookie would be deleted from the users
browser. And Save!


Then open /logout.php immediately after unset($_SESSION["user"]), paste this..
<?php
setcookie("username", "", time()-86400);
setcookie("password", "", time()-86400);
?>

Comments

Keep up to date with our latest articles and uploads...