<?php
require_once"labClass.php";
$con=new labClass();
 
if($_POST["cname"])
 {

 $cname=$_POST["cname"]; 
 
 $cp= $con->getThisAgRecByN($cname); 
 
 if($cp->rowCount()>0)
 {

  $p=$cp->fetch(); 

  echo $p['phone'];
 
 }
 } 
?> 
 