Base 64 Encoder PHP


SUBMITTED BY: Guest

DATE: July 23, 2014, 12:50 p.m.

FORMAT: Text only

SIZE: 2.1 kB

HITS: 890

  1. <?php
  2. /************************************************************************
  3. +----------------------------------------------------------------------+
  4. | base64.php -> Base64 Cipher |
  5. +----------------------------------------------------------------------+ |
  6. | |
  7. | (c) 2002 by M.Abdullah Khaidar (khaidarmak@yahoo.com) |
  8. | |
  9. | This program is free software. You can redistribute it and/or modify |
  10. | it under the terms of the GNU General Public License as published by |
  11. | the Free Software Foundation; either version 2 of the License. |
  12. | |
  13. +----------------------------------------------------------------------+
  14. ************************************************************************/
  15. include "main.php";
  16. $TITLE="Base64 Encoder and Decoder";
  17. $HEADTITLE="Base64 Encoder and Decoder";
  18. top();
  19. echo "<form name=\"Form\" action=\"base64.php\" method=\"post\">\n";
  20. echo "Enter text you want to base64 encode or decode:<br>\n";
  21. echo "<textarea name=\"plain\" cols=40 rows=7 class=\"txtcolor\">\n";
  22. if ($plain){
  23. echo $plain;
  24. }
  25. echo "</textarea><br><br>\n";
  26. echo "<input type=\"submit\" name=\"process\" value=\"Encode\" class=\"txtcolor\">&nbsp;&nbsp;\n";
  27. echo "<input type=\"submit\" name=\"process\" value=\"Decode\" class=\"txtcolor\">\n";
  28. echo "</form>\n";
  29. if ($process=="Encode"){
  30. $cipher=base64_encode($plain);
  31. echo "Text after xoft encode:<br>\n";
  32. echo "<textarea cols=40 rows=7 class=\"txtcolor\">$cipher</textarea><br><br>\n";
  33. }
  34. if ($process=="Decode"){
  35. $cipher=base64_decode($plain);
  36. echo "Text after xoft decode:<br>\n";
  37. echo "<textarea cols=40 rows=7 class=\"txtcolor\">$cipher</textarea><br><br>\n";
  38. }
  39. bottom();
  40. ?>

comments powered by Disqus