diff --git a/palindrome/index.php b/palindrome/index.php deleted file mode 100644 index 74b9c65..0000000 --- a/palindrome/index.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Palindrome Tester - - - -

Palindrome Tester

-
- - -
- - - - diff --git a/palindrome/palindrome.php b/palindrome/palindrome.php deleted file mode 100644 index 025d17c..0000000 --- a/palindrome/palindrome.php +++ /dev/null @@ -1,22 +0,0 @@ -Enter something! diff --git a/palindromed/css/style.css b/palindromed/css/style.css deleted file mode 100644 index c03ec3f..0000000 --- a/palindromed/css/style.css +++ /dev/null @@ -1,84 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Ranchers&display=swap'); -* {margin: 0; padding: 0; box-sizing: border-box; font-family: 'Ranchers', cursive; letter-spacing: 5px;} -nav > a:hover -{ - opacity: .5; -} -nav > a -{ - font-size: 75px; - text-decoration: none; - text-align: center; - margin: 20px; - display: block; - transition: opacity 500ms; -} -span.warning, span.message -{ - text-align: center; - padding: 3px 5px 3px 10px; - display: inline-block; - border-radius: 3px; -} -span.warning {background-color: rgba(200,0,0,.5);} -span.message {background-color: rgba(0,200,0,.5);} -span.contrast {color: white;} -body{background-image: url('../img/watercolor.png');} -main -{ - display: flex; - flex-wrap: wrap; - justify-content: space-around; -} -section -{ - flex-basis: 30%; - padding: 20px; - margin: 5px; - border: 1px solid #777; - background-color: mediumpurple; - color: black; - border-radius: 5px; - box-shadow: 0 8px 6px -6px black; -} -h3 -{ - margin-bottom: 15px; -} -li -{ - letter-spacing: 2px; - margin: 5px; - margin-left: 25px; -} - - -input, select -{ - padding: 8px; - margin: 5px auto; - height: 50px; - font-size: 25px; - display: inline-block; -} -select -{ - padding: 0 -} -form h2 -{ - text-align: center; - margin: 10px auto; - font-size: 30px; - margin-bottom: 50px; -} -form -{ - display: block; - min-height: 400px; - margin: 20px auto; - background-color: lavender; - padding: 20px; - border-radius: 8px; -} -p.warning {text-align: center; margin: 20px auto; padding: 10px; background-color: rgba(150,0,0,.5); width: 75%; border-radius: 8px; color: white; font-size: 25px;} \ No newline at end of file diff --git a/palindromed/img/watercolor.png b/palindromed/img/watercolor.png deleted file mode 100644 index 6e6b77f..0000000 Binary files a/palindromed/img/watercolor.png and /dev/null differ diff --git a/palindromed/index.php b/palindromed/index.php deleted file mode 100644 index bc09f08..0000000 --- a/palindromed/index.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Palindrome Stuff - - - -
-
- - - - Enter Something!

'; - ?> -
-
- - diff --git a/palindromed/palindrome.php b/palindromed/palindrome.php deleted file mode 100644 index 3e02165..0000000 --- a/palindromed/palindrome.php +++ /dev/null @@ -1,89 +0,0 @@ -

There are $wordCounter instances of $sw on this site

"; - } - function output($inputArray, $sw) - { - global $wordCounter; - $return = ""; - foreach($inputArray as $input) - { - if(strpos(strtolower($input), $sw) !== false) $wordCounter++; - - $return .= "

Facts About \"$input\"

"; - $return .= "
"; - } - - return $return; - } - - function isPalindrome($phrase) - { - - //removes spaces from phrase - $phrase = str_replace(" ", "", $phrase); - $phrase = str_replace("'", "", $phrase); - $phrase = str_replace("?", "", $phrase); - $phrase = str_replace("/", "", $phrase); - $phrase = str_replace("\\", "", $phrase); - $phrase = str_replace(".", "", $phrase); - $phrase = str_replace(",", "", $phrase); - - //lower case the phrase - $phrase = strtolower($phrase); - - //reverse phrase and assign to variable - $revPhrase = strrev($phrase); - - //compare and return - if($revPhrase == $phrase) return true; - else return false; - } - - if(!empty($_POST['search-word']) && !empty($_POST['pal-count'])) - { - $searchWord = $_POST['search-word']; - $palCount = $_POST['pal-count']; - } - else header('location: .?error=true'); - - if (!isset($_POST['palindromes'])) - { - $displayPageContent .= '
'; - $displayPageContent .= ''; - $displayPageContent .= ''; - for ($x=0;$x<$_POST['pal-count'];$x++) - $displayPageContent .= '
'; - - $displayPageContent .= ''; - $displayPageContent .= '
'; - } - else - { - $inputs = $_POST['palindromes']; - $displayPageContent .= output($inputs, $searchWord); - $displayPageContent .= wordCountOutput($searchWord); - } -?> - - - - Palindrome Stuff - - - - -
- -
- - \ No newline at end of file diff --git a/spies/composer.json b/spies/composer.json new file mode 100644 index 0000000..25e968a --- /dev/null +++ b/spies/composer.json @@ -0,0 +1,10 @@ +{ + "name": "violet/spies", + "type": "project", + "autoload": { + "psr-4": { + "Violet\\Spies\\": "src/" + } + }, + "require": {} +} diff --git a/spies/css/.gitkeep b/spies/css/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spies/css/styles.css b/spies/css/styles.css new file mode 100644 index 0000000..2d22bb3 --- /dev/null +++ b/spies/css/styles.css @@ -0,0 +1,136 @@ +* { + margin: 0; + padding: 0; +} + +body { + /* Positioning */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + /* Styling */ + background-color: #bbedbe; +} + +h1 { + /* Positioning */ + width: 100%; + padding: 2vw; + + /* Font */ + font-size: 6vw; + text-align: center; +} + +h3 { + font-size: 4vw; +} + +h5 { + font-size: 2vw; +} + +h1, +h3, +h5, +p, +input { + color: #0e3610; +} + +form { + /* Form Shape */ + width: 60%; + padding: 2.5vw 5vw 2.5vw 5vw; + + /* Positioning */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.row { + /* Row Shape */ + width: 100%; + display: flex; +} + +input { + /* Input Shape */ + width: 50%; + padding: 1vw; + margin: 1vw; + border: none; + border-radius: 18px; + + /* Styling */ + background-color: #f1fbf2; + + /* Font */ + font-size: 1vw; + font-weight: 400; +} + +button { + /* Button Shape */ + width: 60%; + padding: 1vw; + margin: 1vw; + border: none; + border-radius: 18px; + + /* Font */ + color: white; + font-size: 1vw; + font-weight: 600; + + /* Transition for hover */ + transition-duration: 500ms; + + background-color: #1c6b20; +} + +button:hover { + background-color: #26942D; +} + +table { + border-spacing: 0; + table-layout: fixed; + width: 40%; + border: 1px solid black; +} + +td { + margin: 0; + padding: 1vw; + border: 1px solid black; + text-align: center; +} + +.card { + padding: 2vw; + background-color: gray; + border-radius: 18px; +} + +.error { + color: white; + background-color: red; +} + +.success { + color: white; + background-color: #0e3610; +} + +.reset { + background-color: #cc0000; +} + +.reset:hover { + background-color: #FF0000; +} diff --git a/spies/hidden.php b/spies/hidden.php new file mode 100644 index 0000000..ac1eee6 --- /dev/null +++ b/spies/hidden.php @@ -0,0 +1,71 @@ + 'roast', 'bob' => 'ross'); +$access = false; + +if (isset($_POST['username']) && isset($_POST['password'])) { + $username = $_POST['username']; + $password = $_POST['password']; + if (array_key_exists($username, $users) && $users[$username] === $password) + $access = true; +} + +$file = 'fbi.txt'; + +function fileRead($file) +{ + if (isset($_GET['fbi'])) + $file = 'fbi.txt'; + else + $file = 'spies.txt'; + if ($access) { + echo "reading $file"; + $fs = fopen($file, 'r'); + $string = fread($fs, filesize($file)); + $values = explode('||>><<||', $string); + + echo ''; + foreach ($values as $v) { + list($a, $b) = explode(',', $v); + + echo ' + + + + + '; + } + echo '
' . $a . '' . $b . '
'; + } else + header('Location: .?access=false'); +} +?> + + + + + Spies + + + + + +

View Confidential Information

+ +Access Granted

'; + + echo ' + + + '; + + fileRead($file); +} +?> + + + + + diff --git a/spies/img/.gitkeep b/spies/img/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spies/includes/fbi.txt b/spies/includes/fbi.txt new file mode 100644 index 0000000..06a9203 --- /dev/null +++ b/spies/includes/fbi.txt @@ -0,0 +1 @@ +skinner,gatekeeper||>><<||csm,alien||>><<||dana,skeptic||>><<||fox,believer \ No newline at end of file diff --git a/spies/includes/spies.txt b/spies/includes/spies.txt new file mode 100644 index 0000000..d67c36a --- /dev/null +++ b/spies/includes/spies.txt @@ -0,0 +1 @@ +dale,the government||>><<||bill,the barber||>><<||hank,the texan||>><<||boomhauer,the marshall \ No newline at end of file diff --git a/spies/index.php b/spies/index.php new file mode 100644 index 0000000..b07f1c2 --- /dev/null +++ b/spies/index.php @@ -0,0 +1,104 @@ + 'roast', + 'bob' => 'ross' +); + +if (isset($_POST['username']) && isset($_POST['password'])) { + $username = $_POST['username']; + $password = $_POST['password']; + if (array_key_exists($username, $users) && $users[$username] === $password) { + $_GET['error'] = false; + $_SESSION['access'] = true; + $_GET['file'] = 'includes/fbi.txt'; + } else { + $_GET['error'] = true; + } +} + +if (isset($_GET['logout'])) { + $_SESSION['access'] = false; + header('Location: .'); +} + +?> + + + + + + Spies + + + + + +

View Confidential Information

+ + + +
+
Access Denied.
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
Access Granted.
+
+
+
+ + + +
+
+ + + + + + +><<||', $string); + + echo ' + + + + + + '; + foreach ($values as $v) { + list($a, $b) = explode(',', $v); + + echo ' + + + + + '; + } + echo '
AgentCodename
' . ucfirst($a) . '' . ucwords($b) . '
'; +} +?> diff --git a/spies/js/.gitkeep b/spies/js/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spies/js/index.js b/spies/js/index.js new file mode 100644 index 0000000..e69de29