在php页面中为html内容创建搜索功能

时间:2019-06-25 02:38:46

标签: javascript php html

我有一个php页面,其中显示F5池成员状态。我想创建一个搜索栏,以便当您开始键入内容时,它仅显示已键入的文本来显示池名称和池成员。有人可以推荐吗?

这是显示池和成员状态的php代码的一部分-

 echo "<center><table cellspacing='6' cellpadding='6' width='100%' 
  border='0'>";
  echo "<tr><th><font size='6'><b>Pools</b></font></th></tr>";
  echo "<tr><td valign='top' width='50%'>";
  foreach ($pool_list as $index=>$pool)
  {
     $pool_name=trim($pool,"/Common/");
     echo "<center><a name='$pool'></a>";
     $availability_status=$poolstatus[$index]->availability_status;
     $img = getgif($availability_status);
     echo "<img src='$img'><b> &nbsp $pool_name</b>";
     echo "<table border='1' cellpadding='5' width='100%'>";
     echo "<tr>";
     echo "<th bgcolor='#ADD8E6' width='25%'>Member IP</th><th bgcolor='#ADD8E6' width='25%'>Member Name</th><th bgcolor='#ADD8E6' width='25%'>Enable Status</th><th bgcolor='#ADD8E6' width='25%'>Current Connections</th></tr>";
     foreach ($memberlist[$index] as $member_index=>$member_value)
     {
        $address=$member_value->member->address;
        $name=$client3->get_screen_name(array($address));
        if ($name[0] == "") { $name[0]=$address; }
        $port=$member_value->member->port;
        $member_name=trim($name[0],"/Common/");
        $sess_status=$member_value->object_status->availability_status;
        $enabled_status=$member_value->object_status->enabled_status;
        $mon_status=$membermonlist[$index][$member_index]->monitor_status;
        $stats=$client2->get_statistics(array($pool),array(array($member_value->member)));
        $ccount=$stats[0]->statistics[0]->statistics[4]->value->low;
        $tcount=$stats[0]->statistics[0]->statistics[6]->value->low;
        echo "<tr>";
        echo "<td bgcolor='#F5F5DC' align='center'> &nbsp $address</td>";
        echo "<td bgcolor='#F5F5DC' align='center'>$member_name</td>";
        $img = getgif_member($sess_status, $enabled_status);
        echo "<td bgcolor='#F5F5DC' align='center'>";
        echo "<img src='$img'>";
        echo "</td>";           
        echo "<td bgcolor='#F5F5DC' align='center'>$ccount</td>";
        echo "</tr>";
     }
     echo "</table>";
  }

0 个答案:

没有答案