Welcome to PHP Discuss

Step One:
Create a Controller CustomPageController.php and save in override/controllers/front.

class CustomPageControllerCore extends FrontController
public $php_self = 'Mypage.php';
public $ssl = true;

public function preProcess()

public function setMedia()

SHA1 RFC 3174 - US Secure Hash Algorithm 1. shan1() function calculates SHA1 hash of string. It produces 160 - bit output called message digest.


string: Required
raw: Optional. Specify hex or binary format
TRUE - Raw 20 character binary
FALSE - Default. 40 character hex number

Return value calculated SHA-1 hash on success, or FALSE on failure.

Modern network applications need accurate and reliable time. NTP is intended to synchronize all participating computers to within a few milliseconds of Coordinated Universal Time (UTC). NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networks under ideal conditions. Asymmetric routes and network congestion can cause errors of 100 ms or more. NTP uses a hierarchical, semi-layered system of time sources.

Socket programming allows us to give our users up to date information. This doesn’t just apply to chat applications but to pushing new comments just made to everyone who is viewing the same article. Pushing comments feature has been added by CNN. If you’re viewing comments made by users, you might see new comments magically appear before your eyes just like in Facebook.

In this tutorial, i’m going to show you how to create a chat room using a socket programming library. In case you’re wondering, this chat will work on old browsers and modern browsers. We will be using the Ratchet library, which has good documentation and is easy to use. Also, once we’re done building our chat room, we’ll be adding the necessary code to make our application workable with the old browsers.

Steps We’re going to be taking or you can watch the video on this:

Web services are client and server applications that communicate over the World Wide Web’s (WWW) HyperText Transfer Protocol (HTTP). Different software systems often need to exchange data with each other, and a Web service is a method of communication that allows two software systems to exchange this data over the internet. The software system that requests data is called a service requester, whereas the software system that would process the request and provide the data is called a service provider.

Ping is a well known tool to check network connectivity between two IP hosts. It was created in 1983 by Mike Muuss who wrote an article about his tool The Story of the PING Program short before dying in 2000 in a car accident.

TTL also stands for transistor-to-transistor logic. Time-to-live (TTL) is a value in an Internet Protocol (IP) packet that tells a network router whether or not the packet has been in the network too long and should be discarded. In computer networking, TTL prevents a data packet from circulating indefinitely. In computing applications, TTL is used to improve performance of caching or to improve privacy.

I needed to implemented TOTP two-factor authentication in a project.
After searching a found a php class somewhere and used it in my project.

Time based one time password works based on current timestamp.
If you face problem time problem in your maching, you can fetch timestamp from ntp server.
For fetching timestamp from ntp server, see my previous post.

I am writing the class here so you can use it.

class TOTP {

const keyRegeneration = 30; // Interval between key regeneration
const otpLength = 6; // Length of the Token generated

No front page content has been created yet.