Advertisement
Shailrshah

Palindrome Check

Apr 28th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. form.html
  2. <html>
  3. <head>
  4.     <title>A form</title>
  5. </head>
  6. <body>
  7.     <form method = "get" action = "test.php">
  8.         <input type = "text" name = "tb" />
  9.         <input type = "submit" value ="Is it a Palindrome?"/>
  10.     </form>
  11. </body>
  12. </html>
  13.  
  14.  
  15. test.php
  16. <html>
  17. <body>
  18.     <?php
  19.         $input = $_GET["tb"];
  20.         $ulta = strrev($input);
  21.         if($input == $ulta) echo "Ye to palindrome nikla! xD";
  22.         else echo "Ye to palindrome nahi hai! :(";
  23.     ?>
  24. </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement