Skip to content
Permalink
8c5f4bbdea
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
15 lines (15 sloc) 588 Bytes
<?php
//This page let initialize the forum by checking for example if the user is logged
session_start();
header('Content-type: text/html;charset=UTF-8');
if(!isset($_SESSION['username']) and isset($_COOKIE['username'], $_COOKIE['password']))
{
$cnn = mysqli_query($var,'select password,id from users where username="'.mysqli_real_escape_string($_COOKIE['username']).'"');
$dn_cnn = mysqli_fetch_array($cnn);
if(sha1($dn_cnn['password'])==$_COOKIE['password'] and mysql_num_rows($cnn)>0)
{
$_SESSION['username'] = $_COOKIE['username'];
$_SESSION['userid'] = $dn_cnn['id'];
}
}
?>