Location: PHPKode > projects > Wiki Web Help > wwh-0.3.8/wwh/handlers/logincheck.php
<?php
    require_once("../config.php");
    
	session_start();
    if(isset($_SESSION['uid'])){
        
    	$uid = $_SESSION['uid'];
        $ip=$_SERVER['REMOTE_ADDR'];
        $level = $_SESSION['level'];
    
        $sql = "SELECT * FROM user WHERE user_id = $uid";
        $result = mysql_query($sql,$con)  or die("{'response':'Database Error'}");
        $user = mysql_result($result, 0, 'user_name');
        if(mysql_num_rows($result)==0){
        	echo "{'response':'no'}";
        	exit;
        } else {
            echo "{'response':'ok','level':'$level','user':'$user','ip':'$ip', 'uid':'$uid'}";
            exit;
        }       
    } 
    echo "{'response':'no'}";
?>
Return current item: Wiki Web Help