Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $text = htmlentities($_GET['text']);
- $hashVal = htmlentities($_GET['hashValue']);
- $fontSize = htmlentities($_GET['fontSize']);
- $style = htmlentities($_GET['fontStyle']);
- $fontStyle = getTag($style);
- $hashedString = "";
- for ($i=0; $i < strlen($text); $i++) {
- if ($i % 2 == 0) {
- $hashedString .= chr(ord($text[$i]) + intval($hashVal));
- }else {
- $hashedString .= chr(ord($text[$i]) - intval($hashVal));
- }
- }
- echo "<p style=\"font-size:$fontSize;$fontStyle\">";
- echo "$hashedString";
- echo "</p>";
- function getTag($style) {
- switch ($style) {
- case "normal":
- case "italic":
- return "font-style:$style;";
- case "bold":
- return "font-weight:bold;";
- default: return "";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement