<? Error_Reporting(E_ALL & ~E_NOTICE); //visual form echo "<title>en/de.coder :) </title>"; echo "<form method='post'><textarea cols='50' rows='15' name='source'></textarea><br>"; echo "Encode <input type='radio' name='method' value='en' checked>"; echo "Decode <input type='radio' name='method' value='de'>"; echo "Writing into the file <input type='checkbox' name='write' value='1'><br><br>"; echo "<input type='Submit' name='Submit'></form><br><br><br>"; //encrypt if ($method == 'en') { $source = gzdeflate($source); $source = base64_encode($source); echo "eval(gzinflate(base64_decode('".htmlspecialchars($source)."')));"; //writing into the file if ($write !== 0) { $handle = fopen("encode.txt", "w+") or die ("Cannot open the file!"); fwrite($handle, $source); fclose($handle); } } //decrypt elseif ($method == 'de') { $source = str_replace("eval(gzinflate(base64_decode('","",$source); $source = str_replace("')));","",$source); $source = base64_decode($source); $source = gzinflate($source); echo $source; //writing into the file if ($write !== 0) { $handle = fopen("decode.txt", "w+") or die ("Cannot open the file!"); fwrite($handle, $source); fclose($handle); } } else echo "Выберите операцию..."; ?>