Here is the code I have so far.. I don't want to go over complex with the coding, as I wan't it as simple as possible.
<html>
<title>Project</title>
<head>
</head>
<body>
<form method="post" action=" ">
Username:<br><input type="text" name="username" value="<?=$_POST["username"]?>"><br>
Password:<br><label name="password" value="<?=$_POST["password"]?>"><br>
Last Log in Date:<br><label name="date" value="<?=$_POST["date"]?>"><br>
<input type="submit" value="search" name="search">
</form>
<?php
$con = mysql_connect("localhost","webuser");
mysql_select_db("nd2_19", $con );
$result = mysql_query( "select * from users", $con );
if(isset($_POST['search']));
{
$con = mysql_connect("localhost","webuser");
mysql_select_db("nd2_19", $con );
}
echo "<table border='1'>
<tr>
<th>Username</th>
<th>Password</th>
<th>Last Login</th>
<th>Email</th>
<th>Contact</th>
<th>Edit</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['lastlogin'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['contact'] . "</td>";
echo "<td>" . $row['edit'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
----------
I want it where you type a username in and click search for all the details to appear. Any help would be appreciated. Please help.
Thanks,
Nick
<html>
<title>Project</title>
<head>
</head>
<body>
<form method="post" action=" ">
Username:<br><input type="text" name="username" value="<?=$_POST["username"]?>"><br>
Password:<br><label name="password" value="<?=$_POST["password"]?>"><br>
Last Log in Date:<br><label name="date" value="<?=$_POST["date"]?>"><br>
<input type="submit" value="search" name="search">
</form>
<?php
$con = mysql_connect("localhost","webuser");
mysql_select_db("nd2_19", $con );
$result = mysql_query( "select * from users", $con );
if(isset($_POST['search']));
{
$con = mysql_connect("localhost","webuser");
mysql_select_db("nd2_19", $con );
}
echo "<table border='1'>
<tr>
<th>Username</th>
<th>Password</th>
<th>Last Login</th>
<th>Email</th>
<th>Contact</th>
<th>Edit</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['lastlogin'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['contact'] . "</td>";
echo "<td>" . $row['edit'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
----------
I want it where you type a username in and click search for all the details to appear. Any help would be appreciated. Please help.
Thanks,
Nick