Login   Register  
PHP Classes
elePHPant
Icontem

File: demo.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2006-04-24 07:21
Size: 663 bytes
 

Contents

Class file image Download
<?php
    
require_once 'Post.inc';  
    
//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;
    }
    
    
//increment
    
$testValue += $step;
   
?>
<html>
    <body>
        <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"/>
        </form>
    </body>
</html>