Jump to content

tobimichigan

Members
  • Posts

    207
  • Joined

  • Last visited

Everything posted by tobimichigan

  1. Yea, thanks Guys that worked but now, it seems to be giving an array error: Here's the code: $pfno=$_GET["pfno"]; $query=mysql_query("Select * From user_table where pfno='$pfno'") or die (mysql_error()); $result=mysql_query($query); $num=mysql_numrows($result); echo "<p> PFNO : ".$_SESSION["pfno"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]); $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"lname"); $f2=mysql_result($result,$i,"fname"); $f3=mysql_result($result,$i,"oname"); $f4=mysql_result($result,$i,"department"); $pfno = mysql_fetch_assoc($result); echo("<p> Welcome".$f1); echo ("Department:".$f3); $i++; } ?> "Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in line 25 Where line 25 is ->this $num=mysql_numrows($result); . Please guys any further pointer to this error?
  2. Hi again code gurus, Please could some help point where this code might be wrong? thanks~ <?php $pfno=$_GET["pfno"]; $query=mysql_query("Select * From user_table where no='$no'") or die (mysql_error()); $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"lname"); $f2=mysql_result($result,$i,"fname"); $f3=mysql_result($result,$i,"oname"); $f4=mysql_result($result,$i,"department"); $pfno = mysql_fetch_assoc($result); echo "<p> PFNO : ".$_SESSION["no"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]); echo("<p> Welcome" $f1); echo("Department:" $f3); $i++; ?> Its indicating that there's a syntax error on: line 37 which is ->echo("<p> Welcome" $f1); It says: Parse error: syntax error, unexpected T_VARIABLE in line 37 where on earth is this unexpected T_Variable?
  3. Oh, I almost forgot, here's now the output: Members Area | Edit Profile | Reports | Logout Welcome USER : 2345(<-this is what I was targeting) Logged in: 08/05/2009. Thanks once again Bj. I'm waiting for your answer on my next question.
  4. Mr James, quite some work u've got there..I suppose u must have invested a lot of energy into these.. Anyways, I'd suggest step by step debugging. Try the functions one by one with a return value and see the output..I guess that'd be good for a start .
  5. Bj, u've just saved the day!!!! Wow, have been working on this University Project for like 4 days now without idea what I could be doing wrong, but alas! You just hit the nail on the head. Here's the corrected code: Login.php <?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='$username'",$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['pfno'] = "$username"; $_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> <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.php <?php session_start(); if($_SESSION["pfno"]=="") { 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> 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()); $pfno = mysql_fetch_assoc($result); echo "<p>Welcome User : ".$_SESSION["pfno"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]); ?> </body> </html> this -> <?php $_SESSION['pfno'] = "$username";?> was where the problem was all these while. Variable Issues...obviously. One more thing Bj, suppose I wanted to retrieve and display information concerning the current user from a table in the db how do I go about it?
  6. Have u tried echoing the session page?
  7. Why not just save urself the stress and use windows or just linux?
  8. In the Members page echo "<p>Welcome User : ".$_SESSION["pfno"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]); simply refers to the authenticated member who is to get the exact pf 4 digits entered on the html-form. That's it's meant to do..except if I'm missing something. Then in the login, $_SESSION['pfno'] = "pfno"; its meant to enable of as a session variable. Is there something I'm still doing wrong here?? Please let me know...
  9. Check out my modification: Login code: <?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='$username'",$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['username'] = "username"; $_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> <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> 2. Member <?php session_start(); if($_SESSION["pfno"]=="") { 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 echo "<p>Welcome User : ".$_SESSION["pfno"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]); ?> </body> </html> As u can see 4 d Login.php <?php //$_SESSION['username'] = "username";?> has been eliminated I'm now left with the <?php $_SESSION['pfno'] = "pfno";?> and in the Member page: <?php session_start(); if($_SESSION["pfno"]=="") { header("location: Login.php"); } include("cn.php"); ?> Yet the pfno still appears as the pfno instead of the value in the base..
  10. Premiso, please where did you say I should put if (!isset($_SESSION["pfno"])), on the login or on the member?
  11. If ur ports are well connected ie localhost, user, pass then I think you should call the attention of your host
  12. It is amazing how someone pointing out something makes you see more items: $_SESSION['pfno'] = "username"; You set pfno to be "username" instead of this 4 code you wanted it to be. That may be a place to start, also see Bjom's comment about the setting of session username. Bjom n Premiso, here's my modified code: 1. 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='$username'",$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['username'] = "username"; $_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> 2. Members.php <?php session_start(); if (!$_SESSION["pfno"]) if (!$_SESSION["username"]) if (!$_SESSION["ledgerno"]) //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 echo ("<p>Welcome PFNO:" .trim($_SESSION['pfno'])); //$pfno=$_GET["pfno"]; //$result=mysql_query("Select * From user_table where pfno='$username'") or die (mysql_error()); //$result=mysql_query($query,$link; //$pfno = mysql_fetch_assoc($result); //echo mysql_num_rows($result); //Display Member Information //print $pfno //echo ("<p>Welcome User:" .$username["pfno"]); //echo ("<p>Welcome: ".trim($_SESSION['username'])); echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"])); ?> </body> </html> I introduced <?php $_SESSION['username']="username" into login.php and <?php if !$_SESSION['username']="username" to members.php The output is as follows: Members Area | Edit Profile | Reports | Logout Welcome PFNO:pfno <-this Logged in: 08/04/2009 The problem still remains pfno. Where PFNO outputs "pfno", is the problem.This ought to be a stored procedure precisely a 4 (say 1234) digit used at the point of registering not pfno which is the name of the column. Please code gurus try harder and help me solve this imbroglio.
  13. Hello again coe gurus, Please I need help in displaying the login value on the 1st page of the current user which I want to be the 1st step in extracting relevant information for the user. Here's my login script: Login.php <?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='$username'",$link); //if(mysql_num_rows($result)>0) { //$row = mysql_fetch_array($result, MYSQL_BOTH); if($ledgerno == $row["ledgerno"]) { $_SESSION['adminok'] = "ok"; $_SESSION['pfno'] = "username"; $_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="username" type="text" id="pfno"></td> </tr> <tr> <td>LEDGER NO. </td> <td>:</td> <td><input name="password" 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 <?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 echo "Welcome $logged $_SESSION[pfno]<br><br>"; //$pfno=$_GET["pfno"]; //$result=mysql_query("Select * From user_table where pfno='$username'") or die (mysql_error()); //$result=mysql_query($query,$link; //$pfno = mysql_fetch_assoc($result); //echo mysql_num_rows($result); //Display Member Information //print $pfno //echo ("<p>Welcome User:" .$username["pfno"]); //echo ("<p>Welcome: ".trim($_SESSION['username'])); echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"])); ?> </body> </html> this-><p>Welcome: ".trim($_SESSION['username'])); code is the one responsible 4 displaying the current user data...but on logon it seems to display either nothing or just username rather than the actual 4 digit value in the pfno column. Please any sharp pointer would be welcomed.
  14. Sensi, of what need is a action when the login itself carries the action? All the code needed for action is on top of the login script.
  15. Heres the form: <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> So what's next sensi?
  16. No sensi, it is not it suppose to be, rather it is supposed to be a varchar precisely 4 numbers not pfno. pfno is the name of the column it holds the varchar (255).
  17. I just did that sensi and its returning 0pfno Here are the codes: 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 print $pfno //echo ("<p>Welcome user" .$user["pfno"]); //echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"])); ?> </body> </html> Any other pointers?
  18. Ionno lol. Its your schema, its your code, what should be in the url of members_area.. what is pfno btw? And which page to they click to get to members_area? Here's how it goes, members_area is accessed from the Login page Login Page code <?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"); } 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> </tr> </table> <p align='center'> </p> </body> </html> After this authentication, members are directed to members_area.php. Where their $pfno is supposed to appear like Welcome PFNO: $pfno Where $pfno is the value stored in the table and is also the means of authentication like username. So then Sensi, how do I get the username or $pfno to display on the members_area with the url?
  19. So Sensi,pls what do I have to do to get it in the url of Members_Area.php?
  20. I've implemented your correction (see code) Here's the code: <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 print $pfno; echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"])); ?> The value in the pfno is a varchar(255). Its apprearing in my table, (maybe u can run the sql table at the beginning of this post. I still can't figure out why its not displaying the select statement.
  21. Members Area | Edit Profile | Reports | Logout 0 Logged in: 08/03/2009 <?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 ($user["pfno"]); echo ("<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"])); ?> Numrows seems to return 0, with this code above after logout. But its still not displaying the real value in the table.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.