Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-20-2007, 12:25 PM   #1
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default my 1337 Convertor

Hey Guys, i just started working on a v. simple text to 1337 converter. What can i do to optimize this:

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
    color: #FF0000;
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
}
body {
    background-color: #333333;
}
.style1 {font-size: 16px}
.style2 {font-size: 18px}
-->
</style></head>

<body>
<div>
<?php

if(!isset($_POST['inputstring'])){
?>
  <form id="form1" name="form1" method="post" action="">
  
    <p>Input String:<br />
      <textarea name="inputstring" cols="48" rows="7" id="inputstring"></textarea>
    </p>
    <p>Output Format:<br />
      <label>
      <select name="outputformat" id="outputformat">
        <option value="1337">Standard 1337</option>
      </select>
      </label> 
     </p>
    <p>
      <label>
      <input type="submit" name="Submit" value="submit" />
      </label>
    </p>
  </form>
  <p>
  <?php
}else{
$inputstring $_POST['inputstring'];
$outputformat $_POST['outputformat'];
if(
$outputformat == "1337"){
$outputstring str_replace("a""4""$inputstring");
$outputstring str_replace("A""4""$outputstring");
$outputstring str_replace("e""3""$outputstring");
$outputstring str_replace("E""3""$outputstring");
$outputstring str_replace("t""7""$outputstring");
$outputstring str_replace("T""7""$outputstring");
$outputstring str_replace("l""1""$outputstring");
$outputstring str_replace("L""1""$outputstring");
$outputstring str_replace("o""0""$outputstring");
$outputstring str_replace("O""0""$outputstring");
?>Conversion Summary:</p>
  <p class="style1">Input Text:<?php echo "$inputstring?> <br />
  Conversion Type: <?php echo "$outputformat"?><br />
  </p>
  <p class="style1"><span class="style2">Conversion Result</span>:</p>
  <p class="style1"><?php echo "$outputstring";?><br />
  <br /><hr />
    <form id="form1" name="form1" method="post" action="">
  
    <p>Input String:<br />
      <textarea name="inputstring" cols="48" rows="7" id="inputstring"></textarea>
    </p>
    <p>Output Format:<br />
      <label>
      <select name="outputformat" id="outputformat">
        <option value="1337">Standard 1337</option>
      </select>
      </label> 
     </p>
    <p>
      <label>
      <input type="submit" name="Submit" value="submit" />
      </label>
    </p>
  </form>
  <p>
    <?php
}}
?>
  </p>
</div>
</body>
</html>
code? There is an example @ http://j03.homedns.org:9999/str.php - That's is my home server (aka desktop pc) so it isnt on 24/7.
__________________

j03 is offline   Reply With Quote
Old 05-21-2007, 01:55 AM   #2
BSOD
 
Join Date: Apr 2005
Posts: 6,556
Send a message via MSN to Rudster816
Default Re: my 1337 Convertor

`/0(_) |\| 33|) 70 /-\ |) |) 7|-|3 1337 alphabet if you catch my drift
http://en.wikipedia.org/wiki/Leet

you dont really to make it more efficent its not that big. there is no reason to try to simplfy it
__________________

Rudster816 is offline   Reply With Quote
Old 05-21-2007, 12:26 PM   #3
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: my 1337 Convertor

Yeah, the "standard 1336" should really be "simple 1336". And thanks
j03 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:04 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0