PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Eugene Panin  >  Semaphore  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Usage example
Class: Semaphore
Form processing locking
Author: By
Last change:
Date: 19 years ago
Size: 400 bytes


Class file image Download
// Example of usage of Semaphore class
include "semaphore.php";

// Processing of double submit click
// Lock the register process till the registration end

$s = new Semaphore($companyFullName);
if (
$s->lock()) {
// Write company to database here
"Company succesfully registered";
else {
"ERROR: You pressed submit button twice";

For more information send a message to info at phpclasses dot org.