Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/old_sites/newepik/include/sessions_php_auth.php

(Deskargatu)
<?php


$nick = $_POST['nick'];
$password = $_POST['password'] or  $password="";
session_start();


if ($chemin[1] == "anonymous") {  session_unset(); }

if (!empty($nick) and !empty($password))
    {	
        $query = "SELECT * FROM membres WHERE pseudo='$nick'";
	$result=mysql_query($query) or die("FATAL: ".mysql_error()."<br>$query");
	if ($row = mysql_fetch_array($result)) { $pass=$row[2]; $email = $row[3]; $axx =$row[9]; }
	if (strcmp($pass,md5($password))==0) 
	    {
		$_SESSION['nick'] = $nick;
		$_SESSION['email'] = $email;
		$_SESSION['axx'] = $axx;		
	    }
	    else { $identified="Failed";	unset($axx); unset($email); unset($nick);}
    }
elseif (sizeof($_SESSION) > 0)
    {
		$nick = $_SESSION['nick'];
		$email = $_SESSION['email'] ;
		$axx = $_SESSION['axx'] ;		
    
    
    }
?>