Hello again,
Ok, i've been working with this for so long to no avail... i've searched and searched and have come up with nothing.... that at least i can understand...
I just want a user to login against a database with their last name and member number, and then be able to update his or her own information in populated fields... i've found the part of the script where if i put in my last name it will give me only my name and all my information to update... but i want the lastname variable to pass from the login page to this PHP script so when they login it will show thier name and information... here is my PHP code for just the query part... :
$result = mysql_query("SELECT * FROM membinfo where lastname='willey'",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], $myrow["lastname"], $myrow["firstname"]);
printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF, $myrow["id"]);
i want to change WILLEY (my last name) to $lastname.... this is the variable i want to pass from my login page...
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form method=post action="<?echo $PHP_SELF?>">
<table cellpadding=2 cellspacing=0 border=0>
<td>Username:</td><td><input type="text" name="lastname" size=10></td><tr>
<td>Password:</td><td><input type="password" name="membernumber" size=10></td><tr>
<td> </td><td><input type="submit" name="login" value="Log In"></td>
</table></form>
<?php
if ($login) {
$db = mysql_connect("localhost", "oataorg_ohioata", "atmedical");
mysql_select_db("oataorg_memdb",$db);
$result=mysql_query("select * from membinfo where lastname='$lastname'",$db) or die ("cant do it");
while ($row=mysql_fetch_array($result)) {
if ($row["membernumber"]==$membernumber) {
printf("Successfully Logged In!<a href=\"newmemupd.php\">Click Here</a>");
}
}
}
?>
</body>
</html>
SO:
1)How can i pass $lastname from the login to the member update page and
2)then how can i have it get the ID number of the lastname so that it can populate the field with that persons info..
does this make sense at all?