PHP Classes
Icontem

File: examples/example.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Ferreira  >  Talk Leet  >  examples/example.php  
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
 

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>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products