<?php
session_start();
if (!isset($_SESSION['id'])) {
header('location:login.php');
}
?>
<!DOCTYPE html>
<html>
<body>
<?php
include_once 'connect.php';
$query=mysqli_query($mysqli,"select * from `users` where userid='".$_SESSION['id']."'");
$row=mysqli_fetch_array($query);
echo 'Welcome - '.$row['username'];
?>
<br>
<a href="logout.php">Logout</a>
<br><br>
<?php
include_once 'connect.php';
$result = mysqli_query($mysqli,"SELECT * FROM users");
echo "<table border='1'>
<tr>
<th>User_ID</th>
<th>Name</th>
<th>Username</th>
<th>E-mail</th>
<th>Department</th>
<th>Date_of_birth</th>
<th>Age</th>
<th>Image</th>
<th>Action</th>
<th>Action</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['userid'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['department'] . "</td>";
echo "<td>" . $row['Date_of_birth'] . "</td>";
echo "<td>" . $row['age'] . "</td>";
echo "<td><img alt='image' style='width:100px;height:50px;' src='upload/".$row['filename']."'></td>";
echo "<td> <a href='editform.php?id=" . $row['userid'] . "'>Edit</a></td>";
echo "<td> <a href='deleteform.php?id=" . $row['userid'] . "'>Delete</a></td>";
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
<?php
//search item
include_once 'connect.php';
if(isset($_POST["happy"])){ // form submission
$name = test_input($_POST["happy"]);
if(empty($_POST["happy"])){ //not empty name
echo "No letter entered";
}
else {
$sql="select name, username, email, Date_of_birth from `users` where userid='$id'";
$query=mysqli_query($mysqli,$sql);
$row=mysqli_fetch_array($query);
if ($row!== FALSE){
print_r($row);
}
else{
echo 'No Record Found';
}
}
}
?>
<!DOCTYPE HTML>
<html>
<body>
<form method="post">
<br><br>
Enter Letter: <input type="text" name="happy"><br><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
Hi everyone i have one issue i,m trying this from four days but unable to fix the issue please i hope you people will help me to solve my problem, i have a welcome page with all the users data who have registered,now in my welcome page their is a input field, so when i enter anyones name,username,emial,D.O.B say pavan or pavan1994@gamil.com , then which all matches row matches with this entered data then only those row should be displayed , i'm trying this from four days but i'm unable to fix the iussue , please guys who all seeing my question please help me i really need help please its a humble request please help me