1337 speak in php

Posts 1–9 of 9 · Page 1 of 1
1337 speak in php
[PHP]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form name="frmLeet" action="http://localhost/leetspeek/index.phpⓘ" method="POST">
<p>Enter your message</p>
<textarea name="sentence" rows="4" cols="60"></textarea>
</ br>
<input type="submit" value="SUBMIT" name="Convert message" />


<?php
// put your code here
// stri[ thee data
IF ($_POST == null)
{return;}


$sentence = $_POST["sentence"];
$leet = $sentence;
$leet = str_ireplace("e","3",$leet ) ;

//output
echo "$sentence<br />";
echo "is converted to <br />";
echo "$leet<br />";


?>

</form>
</body>
</html>[/PHP]









ONLY DOSE

$leet = str_ireplace("e","3",$leet ) ;

REPLACE E WITH 3
all i did....

YOU CAN EDIT AND ADD MORE!
What does this do?
Quote Originally Posted by Doupleganger View Post
DOSE
Does*

and I think it converts the word "leet" to "l33t"
Although a converter from noob to proper english would be more useful.
I agree With Treeham
that seems rly easy and simple
1) The action in your form can just set on #.
2) A form has no name needed -> delete!
3) Wrong way to check whether your form has been sent.
4) Variables should not be in quotes!
5) $leet = $sentence; is not necessary!

[php]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="#" method="post">
<p>Enter your message</p>
<textarea name="sentence" rows="4" cols="60"></textarea>
<br/>
<input type="submit" value="SUBMIT" name="Convert message" />

<?php
// put your code here
// stri[ thee data
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
if(isset($_POST['sentence']))
{
$sentence = $_POST["sentence"];
$leet = str_ireplace("e","3",$sentence ) ;

//output
echo $sentence."<br/>";
echo "is converted to <br/>";
echo $leet."<br/>";
}
}
?>
</form>
</body>
</html>[/php]
yearupi, id do something like

if($_POST['Convert message'] == "SUBMIT")
{
Quote Originally Posted by Ugleh View Post
yearupi, id do something like

if($_POST['Convert message'] == "SUBMIT")
{
You only check if $_POST['Convert message'] have a value of SUBMIT.
It may be that $_POST['sentence'] not exist.
It replaces 'e' with '3', there are more changes you can make to make it more "l33t", change all the l's to 1's and o's to 0's, etc..
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us