rechen-kontrolle - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of rechen-kontrolle.php

  1.  <?php
  2. session_start();
  3. function encrypt($string, $key) {
  4. $result = '';
  5. for($i=0; $i<strlen($string); $i++) {
  6.    $char = substr($string, $i, 1);
  7.    $keychar = substr($key, ($i % strlen($key))-1, 1);
  8.    $char = chr(ord($char)+ord($keychar));
  9.    $result.=$char;
  10. }
  11. return base64_encode($result);
  12. }
  13. $sicherheits_eingabe = encrypt($_POST["sicherheitscode"], "9kk8h6921");
  14. $sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);
  15. if(isset($_SESSION['rechen_captcha_spam']) AND $sicherheits_eingabe == $_SESSION['rechen_captcha_spam']){
  16. unset($_SESSION['rechen_captcha_spam']);
  17.  
  18. //
  19. //
  20. //Hier kommt das ursprüngliche Script hin.
  21. //
  22. //
  23.  
  24. }
  25. ?> 
  26.  
File Description
  • rechen-kontrolle
  • PHP Code
  • 28 Sep-2023
  • 645 Bytes
You can Share it: