Login   Register  
PHP Classes
elePHPant
Icontem

File: ssrch.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of PLSCIS PLP  >  Simple PHP Web Chat  >  ssrch.php  >  Download  
File: ssrch.php
Role: Application script
Content type: text/plain
Description: normal request handler file to search people for adding as contact
Class: Simple PHP Web Chat
Chat system with Websockets or AJAX as fallback
Author: By
Last change: changed description
Date: 2013-12-08 13:43
Size: 552 bytes
 

Contents

Class file image Download
<?php
$qk 
= (isset($_POST['qk']))? $_POST['qk'] : '';
$name = (isset($_POST['name']))? $_POST['name'] : '';
$name preg_replace('/[^A-Za-z0-9]/'''$name);
$name trim($name);
$qk preg_replace('/[^A-Za-z0-9]/'''$qk);
$qk trim($qk);
// $qk = trim($qk, '*');
$op = array();
if(
trim($qk) != '' && $name != '') {
    include_once(
'common.php');
    include_once(
$site_path.'classes'.DIRECTORY_SEPARATOR.'class.SearchPeople.php');
    
$sp_obj = new SearchPeople();
    
$op $sp_obj->findPeople($name$qk);
}
echo 
json_encode($op); exit;
?>