Hello code gurus,
Please I need a charp pointer as to why in the member_area, the value of pfno in the table which is also the username is not echoing out on the screen.
Login:
<?php
session_start();
include("cn.php");
$msg = "";
//require_once('actions/'.$action.'.php');
if (isset($_POST['Submit']))
{
$username = $_POST['pfno'];
$password = $_POST['ledgerno'];
$result = mysql_query("Select * From user_table where pfno='$pfno'",$link);
//if(mysql_num_rows($result)>0)
{
//$row = mysql_fetch_array($result, MYSQL_BOTH);
if($ledgerno == $row["ledgerno"])
{
$_SESSION['adminok'] = "ok";
$_SESSION['pfno'] = "pfno";
$_SESSION['ledgerno'] = "ledgerno";
$_SESSION['valid_time']=time();
header("Location: Members_Area.php?pfno=".$_SESSION['pfno']);
}
else
{
$msg = "ledgerno incorrect";
}
}
//else
{
$msg = "pfno incorrect";
}
}
?>
<!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>Login</title>
</head>
<body>
<div align="center"><img src="../../images/LasustaffCoop2.jpg" alt="" name="LasuStaffCams_Logo" width="700" height="150" id="LasuStaffCams_Logo" /></div>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Members Logon </strong></td>
</tr>
<tr>
<td width="78">PF NO. </td>
<td width="6">:</td>
<td width="294"><input name="pfno" type="text" id="pfno"></td>
</tr>
<tr>
<td>LEDGER NO. </td>
<td>:</td>
<td><input name="ledgerno" type="password" id="ledgerno"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
members_area
<?php
session_start();
if (!$_SESSION["pfno"])
{
//user not logged in, redirect to login page
header("Location:Login.php");
}
include("cn.php");
?>
<!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>LASUSTAFFCAMS MEMBERS</title>
</head>
<body>
<a href="Members_Area.php">Members Area</a> | <a href="Edit_Profile.php">Edit Profile</a> | <a href="Reports.php">Reports</a> | <a href="Logout.php">Logout</a>
<?php
$pfno=$_GET["pfno"];
$result=mysql_query("Select * From user_table where pfno='$pfno'") or die (mysql_error());
//$result=mysql_query($query,$link;
$user = mysql_fetch_assoc($result);
echo mysql_num_rows($result);
//Display Member Information
echo ("<p>Welcome user" .$user["pfno"]);
echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]));
?>
</body>
</html>