Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Ferreira  >  Talk Leet  >  examples/example.php  >  Download  
File: examples/example.php
Role: Example script
Content type: text/plain
Description: Example script on how to use Leet Talk
Class: Talk Leet
Convert words to "leet" speak and vice-versa
Author: By
Last change: Update
Date: 6 years ago
Size: 986 bytes
 

Contents

Class file image Download
<?php
if ($_POST)
{
    require 
"talkleet.class.php";
    
$leet = new Talkleet();
    
$leet->encode($_POST['string1']);
    
$leet->decode($_POST['string2']);
    if (
$_POST['string1'] && !$_POST['string2'])
    {
        echo 
"<center><font color=\"#c0c0c0\">",$leet->encode(htmlspecialchars($_POST['string1'])),"</font></center>";
    }
    elseif (!
$_POST['string1'] && $_POST['string2'])
    {
        echo 
"<center><font color=\"#c0c0c0\">",$leet->decode(htmlspecialchars($_POST['string2'])),"</font></center>";
    }
    else
    {
        echo 
"<center><font color=\"#c0c0c0\">Only fill one option (encode or decode).</font></center>";
    }
}
?>

<form action="example.php" method="post">
<table>
<tr>
    <td>L33t Encode</td>
    <td><input type="text" name="string1"></td>
</tr>
<tr>
    <td>L33t Decode</td>
    <td><input type="text" name="string2"></td>
</tr>
<tr>
    <td></td>
    <td><input type="submit" value="L33t!" name="submit"></td>
</tr>
</table>
</form>