SORRY FOR MY BAD ENGLISH.
I CAN DO MY LOGIN PROGRAM BUT I CANT OUT INDIVIDUAL INFORMATION.
this is my login program
Code:
<?php require_once('Connections/Connection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_Connection, $Connection);
$query_datalogin = "SELECT * FROM users";
$datalogin = mysql_query($query_datalogin, $Connection) or die(mysql_error());
$row_datalogin = mysql_fetch_assoc($datalogin);
$totalRows_datalogin = mysql_num_rows($datalogin);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "Userslevel";
$MM_redirectLoginSuccess = "test-members.php";
$MM_redirectLoginFailed = "test-login.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_Connection, $Connection);
$LoginRS__query=sprintf("SELECT UserName, Password, Userslevel FROM users WHERE UserName=%s AND Password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "int"));
$LoginRS = mysql_query($LoginRS__query, $Connection) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'Userslevel');
if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<label for="username">Username :</label>
<input type="text" name="username" id="username" />
<br />
<label for="password">Password :</label>
<input type="password" name="password" id="password" />
<br />
<input type="submit" name="btnlogin" id="btnlogin" value="Log in!!" />
</form>
</body>
</html>
<?php
mysql_free_result($datalogin);
?>
AND THIS IS ALREADY LOGIN.
Code:
<?php require_once('Connections/Connection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_Connection, $Connection);
$query_datauser = "SELECT * FROM users";
$datauser = mysql_query($query_datauser, $Connection) or die(mysql_error());
$row_datauser = mysql_fetch_assoc($datauser);
$totalRows_datauser = mysql_num_rows($datauser);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php session_start(); ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p><?php echo $_SESSION['MM_Username']; ?>
</p>
<p> </p>
</body>
</html>
<?php
mysql_free_result($datauser);
?>
I would like to show just his information.
for example when i log in to Usename : potato i just want to show his BANK , PVSELF , PVCOLLECT , ect
for example when i log in to Usename : toohoo i just want to shouw his BANK , PVSELF : 500 , PVCOLLECT = 0 : ect just only one profile
I did it but i only can show all of these profile but i cant show just only what i want.
sorry for my bad english


if i wanna show just his detail what should i do ? THX FOR ADVANCE
Bookmarks