PHP Classes

File: demo.php

Recommend this page to a friend!
  Classes of Jaroslaw Katnik   Post   demo.php   Download  
File: demo.php
Role: Example script
Content type: text/plain
Description: Shows how to use the class.
Class: Post
Wrap the access to the HTTP POST request values
Author: By
Last change:
Date: 16 years ago
Size: 663 bytes


Class file image Download
require_once '';
//get instance
$post = Post::getInstance();
//get data - access $_POST array as it would be an object
$testValue = $post->testValue;
$step = $post->step;
    if (
$step == null) {
$step = 1;
$testValue += $step;
        <form method="POST">
            Value to be incremented: <input type="text" name="testValue" value="<?=$testValue?>"/>
            <br/>Step: <input type="text" name="step" value="<?=$step?>"/>
            <br/><input type="submit" value="increment"/>