<form id="form1" name="form1" method="post" action=" <?php
include("connect.php");
require("search2.php");
$username = $_SESSION['email'];
?>
">
<p>
<input type="text" name="search" id="search" value=""/>
<input type="submit" name="btnSearch" id="btnSearch" value="SEARCH" />
</p></form>
search2.php
<?php
include("connect.php");
$username = $_SESSION['email'];
$name=$_POST['search'];
$query = mysql_query ("Select * from confirm_members where email = '$name'");
if(mysql_num_rows($query)==0)
die ("User not found");
else
{
while ($row = mysql_fetch_array($query))
{
$members = $row ['email'];
$location = $row ['imagelocation'];
echo "<img src ='$location' width='100' height='100'>"."<a href= 'friendprofile.php?MemberID=$members'>".$members;
}
}
$search = mysql_query ("Select * from friends where user1 = '$username' && user2 = '$name' ");
if(mysql_num_rows($search)==0)
echo "</a>"." "." "."<a href='addfriend.php?MemberID=$members'>"."Add as friend"."</a>"."</p>";
else
{
while ($row = mysql_fetch_array($query))
{
$username = $row ['user1'];
$name = $row ['user2'];
$stat = $row ['status'];
}
}
?>
makibao -3 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
makibao -3 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.