I'm a beginner of PHP so I don't know what is the reason and what is the problem. when I execute the code
Notice: Undefined index: sr in C:\wamp\www\mit\search.php on line 7
displayed but, search operation is working.
search.php
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("display") or die ("could not find db"); 
 $output ='';
 if (isset ($_POST['sr']));
$search = $_POST['sr'];
$query = mysql_query("SELECT * FROM photos WHERE firstname LIKE '%$search%'" 
)   or die("could not search");
$count = mysql_num_rows($query);
if($count == 0)
{
    $output = 'There was no search results !';
    }
    else
    {
    while($row = mysql_fetch_array($query))
    {
    $fname = $row['firstname'];
    $lastname = $row['lastname'];
    $fathername = $row['fathername'];
    $mothername = $row['mothername'];
    $sex = $row['sex'];
    $dob = $row['dob'];
    $religion = $row['religion'];
    $email = $row['email'];
    $password = $row['password'];   
    $cell = $row['cell'];   
    $tphone = $row['tphone'];   
    $address = $row['address'];
    $town = $row['town'];   
    $city=$row['city'];
    $state=$row['state'];
    $country=$row['country'];
    $pin=$row['pin'];
    $nationality=$row['nationality'];
    $eq1=$row['eq1'];
    $eq2=$row['eq2'];
    $eq3=$row['eq3'];
    $eq4=$row['eq4'];
    $location=$row['location'];
    //$output .='<div> '.$fname.''.$lastname.'</div>';
    $output .='<table border="1px"><tr><td>'.$fname.'</td>
 <td>'.$lastname.'</td>'.$fathername.'</td><td>'.$mothername.'</td>
<td>'.$sex.'</td><td>'.$dob.'</td><td>'.$religion.'</td><td>'.$email.'</td>
<td>'.$password.'</td><td>'.$cell.'</td><td>'.$tphone.'</td>
<td>'.$address.'</td><td>'.$town.'</td><td>'.$city.'</td><td>'.$state.'</td>
<td>'.$country.'</td><td>'.$pin.'</td><td>'.$nationality.'</td>
<td>'.$eq1.'</td><td>'.$eq2.'</td><td>'.$eq3.'</td><td>'.$eq4.'</td><td><img 
width="100px" height="100px" src="'.$location.'">'.'</td></tr></table>';
    }
    }
?>
<html>
<head>
<title>search</title>
</head>
 <body>
<form action="search.php" method="post">
<input type="text" name="sr" placeholder="search for members"/> 
<input type="submit" value="Search"/>
</form>
<?php echo $output;?>
</body>
</html> 
 
     
     
     
    