Sample> RegexControl

<?php

// include TPLN
include('TPLN/TPLN.php');

$TPLN = new TPLN();
$TPLN->open('regexControl.html');

// here it is checked that the field edit2 is a postal code and one specifies the error message.
$TPLN->notEmpty('ZipCode''Please enter an zip code');
$TPLN->regexControl('^((2[A-B])|([0-9]{2}))[0-9]{3}$','ZipCode','Please only type a Zip Code');

if(
$TPLN->formIsValid())
{
    
// your treatment here ...
}
$TPLN->write();

?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> regexControl.html </title>
    <link href="../style.css" rel="stylesheet" type="text/css" />
</head>

<body>

  <form action="" method="post" name="form">

   What is your Postal Code ?

   <p><input type="text" name="ZipCode" id="ZipCode" value=""></p>
   <p><input type="submit" name="button1" value="Send"></p>

  </form>

<bloc::form_valid>
<div id="form_valid">
Your form was submitted without errors !<br>
And replaced by bloc form_valid !
</div>
</bloc::form_valid>

<br>
<br>

{_Logo}<font size="1"> in {_Chrono} s<br>
Queries executed: {_QueryCount}</font>

</body>
</html>