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.
Result of php executing
Full code of rechen-kontrolle.php
- <?php
- session_start();
- function encrypt($string, $key) {
- $result = '';
- for($i=0; $i<strlen($string); $i++) {
- $char = substr($string, $i, 1);
- $keychar = substr($key, ($i % strlen($key))-1, 1);
- $char = chr(ord($char)+ord($keychar));
- $result.=$char;
- }
- return base64_encode($result);
- }
- $sicherheits_eingabe = encrypt($_POST["sicherheitscode"], "9kk8h6921");
- $sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);
- if(isset($_SESSION['rechen_captcha_spam']) AND $sicherheits_eingabe == $_SESSION['rechen_captcha_spam']){
- unset($_SESSION['rechen_captcha_spam']);
- //
- //
- //Hier kommt das ursprüngliche Script hin.
- //
- //
- }
- ?>