PHP Classes

File: history.php

Recommend this page to a friend!
  Classes of PLSCIS PLP   Simple PHP Web Chat   history.php   Download  
File: history.php
Role: Application script
Content type: text/plain
Description: normal request handler file to display user's history
Class: Simple PHP Web Chat
Chat system with Websockets or AJAX as fallback
Author: By
Last change: changed role and description
Date: 10 years ago
Size: 821 bytes
 

Contents

Class file image Download
<?php
$name
= (isset($_GET['name']))? $_GET['name'] : '';
$q = (isset($_GET['q']))? $_GET['q'] : '';
if(
is_string($name)) { $name = trim($name); } else { $name = ''; }
if(
is_string($q)) { $q = trim($q); } else { $q = ''; }
$name = preg_replace('/[^A-Za-z0-9]/', '', $name);
$name = trim($name);
$q = preg_replace('/[^A-Za-z0-9:-]/', '', $q);
$q = trim($q);
$eauth = false;
if(
$name != '' && q != '') {
    include_once(
'common.php');
    include_once(
$site_path.'classes'.DIRECTORY_SEPARATOR.'class.History.php');
   
$h_obj = new ChatHistory();
   
$eauth = $h_obj->getHistory($name, $q);
}
if(
$eauth === false) {
?>
<form name="frm" id="frm" action="" method="post">
<input type="password" name="pass" id="pass" value="" />
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
<?php
}
?>