Advertisement
cdsatrian

testing v2

Jul 11th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  4. <meta name="author" content="RieqyNS13"/>
  5. <meta name="updater" content="C4Hy4"/>
  6. <title>Testing</title>
  7. <style type="text/css">
  8. body{
  9.   background-color:#000000;
  10. }
  11. textarea{
  12.   background-color:#000000;
  13.   color:#FF0000;
  14. }
  15. input{
  16.   background-color:#000000;
  17.   color:#FF0000;
  18. }
  19. fieldset{
  20.   color:#7FFF00;
  21.   font-family:"Courier New";
  22.   font-size:10px;
  23.   border:1px solid;
  24.   width:373px;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <br>
  30. <form method=POST action=<?PHP $_SERVER['PHP_SELF'];?>>
  31. <fieldset>
  32. <legend>Isi Input</legend>
  33. <textarea name="txArea" cols=50 rows=20 value="<?php echo isset($_POST['txArea'])?$_POST['txArea']:"";?>"></textarea>
  34. </fieldset>
  35. <input type=submit name="btnSubmit" value="Generate"><br>
  36. <?php
  37. $result = '';
  38. if (isset($_POST['txArea'])){
  39.   $str = $_POST['txArea'];
  40.   $exp = explode("\n", $str);
  41.   $count = count($exp);
  42.   for($i=0; $i<$count; $i++){
  43.     $result .= "Hello ".preg_replace('/(\s|\\\\[rn]{1})/', '',$exp[$i])." Problem ? \n";
  44.   }
  45.   echo "<fieldset><legend>Output :</legend>\n<textarea name='txResult' cols=50 rows=20 readonly=YES>$result</textarea></fieldset><br>";
  46. }
  47. ?>
  48. </form>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement