diff --git a/app/close_session.php b/app/close_session.php new file mode 100644 index 0000000..f66aca3 --- /dev/null +++ b/app/close_session.php @@ -0,0 +1,6 @@ + "admin", "password" => "admin"]); + +if (isset($_SESSION['userName'])) { + $url = '../resources/views/panel.php'; + header('Location: ' . $url); + exit(); +} else if (isset($_POST['userName']) && isset($_POST['password'])) { + $userName = $_POST['userName']; + $password = $_POST['password']; + + if ($userName === user["userName"] && $password === user["password"]) { + $_SESSION['password'] = $password; + $_SESSION['userName'] = $userName; + $url = '../resources/views/panel.php'; + header('Location: ' . $url); + } else { + + define("ERRORMSG", ''); + setcookie("IncorrectLoginCookie", ERRORMSG, time() + 1, "/"); + header('Location: ../public/index.php '); + exit(); + } + + exit(); +}; diff --git a/index.php b/index.php index 8c68540..3442c73 100644 --- a/index.php +++ b/index.php @@ -9,6 +9,11 @@ + @@ -48,8 +53,9 @@ Documentation -
- +
diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..13f4ecd --- /dev/null +++ b/public/index.php @@ -0,0 +1,61 @@ + + + + + + + + Index + + + + + + +
+
+
+
+

Login!!

+
+
+ +
+ +

User Name

+ +

Password

+ + +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/resources/assets/img/aut.gif b/resources/assets/img/aut.gif new file mode 100644 index 0000000..88e51df Binary files /dev/null and b/resources/assets/img/aut.gif differ diff --git a/resources/styles.css b/resources/styles.css new file mode 100644 index 0000000..5336c2e --- /dev/null +++ b/resources/styles.css @@ -0,0 +1,95 @@ +@import url("https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700"); +@import url("https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"); +@import url("https://fonts.googleapis.com/css?family=Raleway:100,400,600,700,900&display=swap"); + +html { + font-family: Raleway; + scroll-behavior: smooth; + background-image: url("./assets/img/aut.gif"); + background-repeat: no-repeat; + background-color: black; + background-size: cover; +} + +.header .box { + min-height: 10vh; +} + +.main { + margin: 10px 30px; +} + +.userlogin .box { + margin: 0px 40px; + min-height: 3vh; + max-width: inherit; + justify-content: flex-end; +} +.flex { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + transition: all 0.7s; +} + +.box { + display: flex; + flex-wrap: wrap; + max-width: 90%; + justify-content: space-around; + border-radius: 3%; + border: solid rgb(65, 12, 12) 2px; + text-align: center; + margin: 2% 1%; + padding: 1%; + min-height: 35vh; + background-color: rgba(119, 60, 37, 0.459); +} +.box .title { + color: rgb(221, 202, 118); + text-shadow: 1px 3px rgb(196, 120, 85); + min-width: 100%; + max-height: 10vh; + font-size: large; + z-index: 1; +} +.box .info { + color: rgb(221, 202, 118); + + z-index: 1; + font-size: medium; +} +.box h3 { + font-family: monospace; + color: rgb(221, 202, 118); + text-align: left; +} +.btn { + outline: rgb(65, 12, 12) solid 1px; + color: rgb(221, 202, 118); + margin: 0px 20px; + background-color: rgba(119, 60, 37, 0.459); + padding: 0.5% 2%; + font-size: 0.7rem; + cursor: pointer; + text-align: center; + + height: min-content; +} + +.item { + padding: 0.6%; + border: solid rgb(221, 202, 118) 2px; + color: rgb(221, 202, 118); + text-shadow: 1px 3px rgb(196, 120, 85); + border-radius: 3%; + height: fit-content; + max-height: 5vh; +} + +input[type="text"], +input[type="password"] { + color: white; + background-color: rgba(119, 60, 37, 0.459); +} diff --git a/resources/views/arrays.php b/resources/views/arrays.php new file mode 100644 index 0000000..5bc28a9 --- /dev/null +++ b/resources/views/arrays.php @@ -0,0 +1,172 @@ + + + + + + + + Arrays + + + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Count

+
+
+

+ +

+

+ ' . count($textArray) . '
'; + ?> +

+
+
+
+
+

Merge

+
+
+

+ +

+

+ +

+
+
+
+
+

End

+
+
+

+ +

+

+ '; + ?> +

+
+
+
+
+

Push

+
+
+

+ +

+

+ '; + array_push($numbersArray, $insertNumber); + print_r($numbersArray); + ?> +

+
+
+
+
+ + + + \ No newline at end of file diff --git a/resources/views/conditionals.php b/resources/views/conditionals.php new file mode 100644 index 0000000..eb1aea1 --- /dev/null +++ b/resources/views/conditionals.php @@ -0,0 +1,194 @@ + + + + + + + + Conditionals + + +"; +$todayDay = date('d'); +$textTwo = 'This is using "print"' . '
'; +$textThree = ['This ', 'is ', 'using ', '"print_r" ']; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Simple condition 1

+
+
+

+ +

+

+ '; + ?> +

+
+
+
+
+

Simple condition 2

+
+
+

+ +

+

+ +

+
+
+
+
+

Double Condirion

+
+
+

+ = "15") ?' . $br; + echo '"the current minute is more than 15" :' . $br; + echo '"does not meet any conditions" ;' . $br; + ?> +

+

+ = '15') ? 'the current minute is more than 15' : 'does not meet any conditions'; + ?> +

+
+
+
+
+

Switch

+
+
+

+ +

+

+ '; + break; + case '30': + echo "bye?" . '
'; + break; + case '31': + echo "bye bye" . '
'; + break; + default: + echo "May be another day" . '
'; + } + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/dates.php b/resources/views/dates.php new file mode 100644 index 0000000..2f9aaa3 --- /dev/null +++ b/resources/views/dates.php @@ -0,0 +1,181 @@ + + + + + + + + Dates + + +'; +define("CURRENT_DATE", date('Y-m-d')); +$date = new DateTime('1987-09-14'); +$textTwo = 'This is using "print"' . '
'; +$textThree = ['This ', 'is ', 'using ', '"print_r" ']; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Current Date

+
+
+

+ +

+

+ +

+
+
+
+
+

Date Format

+
+
+

+ +

+

+ +

+
+
+
+
+

Date Day

+
+
+

+ +

+

+ '; + ?> +

+
+
+
+
+

Date Month

+
+
+

+ +

+

+ +

+
+
+
+
+

Date Year

+
+
+

+ +

+

+ +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/functions.php b/resources/views/functions.php new file mode 100644 index 0000000..3b62190 --- /dev/null +++ b/resources/views/functions.php @@ -0,0 +1,124 @@ + + + + + + + + Functions + + +'; +$mathOperators = ["+", "-", "*", "/", "%"]; +function numbers($a = 0, $b = 100) +{ + $n = random_int($a, $b); + return strval($n); +}; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Functions

+
+
+

+ +

+

+ '; + } + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/info.php b/resources/views/info.php new file mode 100644 index 0000000..d83f5d7 --- /dev/null +++ b/resources/views/info.php @@ -0,0 +1,109 @@ + + + + + + + + PHP-INFO + + + + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Echo

+
+
+

+ +

+

+ +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/iterators.php b/resources/views/iterators.php new file mode 100644 index 0000000..8bc2cb4 --- /dev/null +++ b/resources/views/iterators.php @@ -0,0 +1,183 @@ + + + + + + + + Iterators + + +'; +$number = 5; +$numberTwo = 1; +$letters = ['q', 'w', 'e', 'r', 't', 'y']; +$textThree = ['This ', 'is ', 'using ', '"print_r" ']; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

For

+
+
+

+ +

+

+ '; + } + ?> +

+
+
+
+
+

Foreach

+
+
+

+ +

+

+ '; + } + ?> +

+
+
+
+
+

While

+
+
+

+ 0) {' . $br; + echo 'echo "Decrement count " . $number' . $br; + echo '$number--;' . $br; + echo '}'; + ?> +

+

+ '; + } + ?> +

+
+
+
+
+

For

+
+
+

+ = 0);'; + ?> +

+

+ '; + $number--; + } while ($number >= 0); + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/maths.php b/resources/views/maths.php new file mode 100644 index 0000000..2bbc9ac --- /dev/null +++ b/resources/views/maths.php @@ -0,0 +1,152 @@ + + + + + + + + Maths + + +'; +$mathOperators = ["abs", "round", "max", "min"]; + +function numbers($a = 0, $b = 100) +{ + $n = random_int($a, $b); + return strval($n); +}; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Math Functions

+
+
+

+ +

+

+ '; + } + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/operators.php b/resources/views/operators.php new file mode 100644 index 0000000..c76f462 --- /dev/null +++ b/resources/views/operators.php @@ -0,0 +1,184 @@ + + + + + + + + Operators + + +'; +$mathOperators = ["+", "-", "*", "/", "%"]; +$comparisionOperators = ['==', '!=', '<', '>', '<=', '>=']; +$logicalOperators = ['&&', ' And ', '||', ' Or ', '!', ' Xor ']; + +function numbers($a = 0, $b = 100) +{ + $n = random_int($a, $b); + return strval($n); +}; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Math Operators

+
+
+

+ +

+

+ '; + } + ?> +

+
+
+
+
+

Comparision Operators

+
+
+

+ " . ($result == 1 ? "true" : "false")' . $br; + echo '}'; + ?> +

+

+ ' . ($result == 1 ? 'true' : 'false') . '
'; + } + ?> +

+
+
+
+
+

Logical Operators

+
+
+

+ "' . $br; + echo '. ($result == 1 ? "true" : "false") . ' . $br; + echo '}'; + ?> +

+

+ ' . ($result == 1 ? 'true' : 'false') . '
'; + } + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/panel.php b/resources/views/panel.php new file mode 100644 index 0000000..0c9fefb --- /dev/null +++ b/resources/views/panel.php @@ -0,0 +1,103 @@ + + + + + + + + Home + + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+ Welcome ' . $userName . ' !!'; + ?> +
+
+

+ This is a simple web App make with PHP to learn PHP! +

+

+ Enjoy it! +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/print.php b/resources/views/print.php new file mode 100644 index 0000000..0cbd229 --- /dev/null +++ b/resources/views/print.php @@ -0,0 +1,147 @@ + + + + + + + + Print + + +'; +$textTwo = 'This is using "print"' . '
'; +$textThree = ['This ', 'is ', 'using ', '"print_r" ']; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Echo

+
+
+

+ "echo $textOne;"'; + ?> +

+

+ +

+
+
+
+
+

Print

+
+
+

+ "print $textTwo;"'; + ?> +

+

+ +

+
+
+
+
+

Print_r

+
+
+

+ "print_r($textThree);"'; + ?> +

+

+ '; + print_r($textThree); + echo ''; + ?> +

+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/strings.php b/resources/views/strings.php new file mode 100644 index 0000000..1441fbb --- /dev/null +++ b/resources/views/strings.php @@ -0,0 +1,240 @@ + + + + + + + + Strings + + +'; +$textOne = 'This is a text string that interpret variables' . $br; +$textTwo = 'This is using "echo"' . $br; +$textThree = 'The length of this is '; +function numbers($a = 0, $b = 100) +{ + $n = random_int($a, $b); + return strval($n); +}; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Replace

+
+
+

+ +

+

+ +

+
+
+

+ +

+

+ +

+
+ +
+
+
+

Uppercase/Lowercase

+
+
+

+ +

+

+ +

+
+
+

+ +

+

+ +

+
+ +
+
+
+

Repeat

+
+
+

+ +

+

+ +

+
+
+

Length

+
+
+

+ +

+

+ +

+
+
+ +
+
+

Find Char

+
+
+

+ "" .' . $br; + echo '$textThree . "" => . stripos($textThree, $selectChar);' . $br; + ?> +

+

+ "' . $textThree . '" =>' + . stripos($textThree, $selectChar) . $br; + ?> +

+
+
+
+
+

Find Substring

+
+
+

+ "" . $textThree . """' . $br; + ?> +

+

+ "' . $textThree . '"' . $br; + ?> +

+
+
+
+
+ + + + \ No newline at end of file diff --git a/resources/views/types.php b/resources/views/types.php new file mode 100644 index 0000000..cc0cd1b --- /dev/null +++ b/resources/views/types.php @@ -0,0 +1,134 @@ + + + + + + + + Types + + +"; +$types = [ + 'boolean' => true, + 'integer' => 7, + 'float' => 34.5, + 'string' => "WOLOLOOOOOO", + 'array' => ['This text is inside of an array'], + 'NULL' => null +]; + +class objectVariable +{ + public $text = 'this text is inside an object'; +} +$object = new objectVariable(); +$objectParam = 'text'; +?> + + alert("This is a private section, please login");'); + setcookie("NotLoggedCookie", ERRORMSG, time() + 1, "/"); + exit(); +}; +$userName = $_SESSION['userName']; +?> + + + +
+
+
+
+

Types

+
+
+

+ $value) {' . $br; + echo 'echo gettype($value) === "array" ? "$" . $key . " = " . $value[0] . " is " . gettype($value) :' . $br; + echo '"$" . $key . " = " . $value . " => " . gettype($value) ;' . $br; + echo '}'; + ?> +

+

+ $value) { + echo gettype($value) === 'array' ? '$' . $key . ' = ' . $value[0] . ' is ' . gettype($value) . '
' : + '$' . $key . ' = ' . $value . ' => ' . gettype($value) . '
'; + } + + echo $object->$objectParam . ', and the variable $object is ' . gettype($object) . '
'; + + ?> +

+
+
+
+
+ + + \ No newline at end of file