From 3cc99820090e5d2f2b942f0828a902dd627d56f8 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 23 Aug 2024 16:01:22 +0200 Subject: [PATCH 1/4] asd --- www/public/Moment-1/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/public/Moment-1/index.php b/www/public/Moment-1/index.php index 5841e89..7f7f2c9 100644 --- a/www/public/Moment-1/index.php +++ b/www/public/Moment-1/index.php @@ -2,7 +2,7 @@ -

Matematik-test

+

Moment-1

Valutakonverterare From 734f47008fa5fc648e58385cf45811baf7353551 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 26 Aug 2024 08:41:08 +0200 Subject: [PATCH 2/4] asd --- www/public/Moment-0/evaluate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/public/Moment-0/evaluate.php b/www/public/Moment-0/evaluate.php index 1be99d9..91bf30c 100644 --- a/www/public/Moment-0/evaluate.php +++ b/www/public/Moment-0/evaluate.php @@ -7,8 +7,8 @@ Date: Mon, 26 Aug 2024 10:40:59 +0200 Subject: [PATCH 3/4] we going places --- www/public/Moment-2/FeetBook/Person.php | 49 ++++++++++++++++++++++ www/public/Moment-2/FeetBook/cleanData.php | 24 +++++++++++ www/public/Moment-2/FeetBook/start.php | 29 +++++++++++++ www/public/Moment-2/Upg1/strip_tag.php | 16 +++++++ www/public/Moment-2/Upg2/räknare.php | 16 +++++++ www/public/Moment-2/Upg3/foreacharray.php | 19 +++++++++ www/public/Moment-2/Upg4/beräkning.php | 26 ++++++++++++ www/public/Moment-2/Upg4/math.php | 31 ++++++++++++++ www/public/Moment-2/index.php | 17 ++++++++ www/public/index.php | 1 + 10 files changed, 228 insertions(+) create mode 100644 www/public/Moment-2/FeetBook/Person.php create mode 100644 www/public/Moment-2/FeetBook/cleanData.php create mode 100644 www/public/Moment-2/FeetBook/start.php create mode 100644 www/public/Moment-2/Upg1/strip_tag.php create mode 100644 www/public/Moment-2/Upg2/räknare.php create mode 100644 www/public/Moment-2/Upg3/foreacharray.php create mode 100644 www/public/Moment-2/Upg4/beräkning.php create mode 100644 www/public/Moment-2/Upg4/math.php create mode 100644 www/public/Moment-2/index.php diff --git a/www/public/Moment-2/FeetBook/Person.php b/www/public/Moment-2/FeetBook/Person.php new file mode 100644 index 0000000..8a02069 --- /dev/null +++ b/www/public/Moment-2/FeetBook/Person.php @@ -0,0 +1,49 @@ + + + + + + Document + + + förnamn = $förnamn; + $this->efternamn = $efternamn; + $this->användarnamn = $användarnamn; + $this->lösenord = $lösenord; + } + + public function getförnamn() { + return $this->förnamn; + } + + public function getefternamn() { + return $this->efternamn; + } + + public function getanvändarnamn() { + return $this->användarnamn; + } + + public function getlösenord() { + return $this->lösenord; + } + + public function setlösenord($lösenord) { + $this->lösenord = $lösenord; + } +} +?> + + \ No newline at end of file diff --git a/www/public/Moment-2/FeetBook/cleanData.php b/www/public/Moment-2/FeetBook/cleanData.php new file mode 100644 index 0000000..8a8ccf3 --- /dev/null +++ b/www/public/Moment-2/FeetBook/cleanData.php @@ -0,0 +1,24 @@ + + + + + + Document + + + + + \ No newline at end of file diff --git a/www/public/Moment-2/FeetBook/start.php b/www/public/Moment-2/FeetBook/start.php new file mode 100644 index 0000000..65ae8a7 --- /dev/null +++ b/www/public/Moment-2/FeetBook/start.php @@ -0,0 +1,29 @@ + + + + + + FeetBook + + +

FeetBook

+ +
+ Sign up + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/www/public/Moment-2/Upg1/strip_tag.php b/www/public/Moment-2/Upg1/strip_tag.php new file mode 100644 index 0000000..19705df --- /dev/null +++ b/www/public/Moment-2/Upg1/strip_tag.php @@ -0,0 +1,16 @@ + + + + + + Document + + + World
", "
"); + echo("I en strip_tags används , efter för att deklerera vilka taggar som tillåts. + Det som är farligt med detta är att man kan skicka över taggar som kan vara skadliga och användas i XSS-attacker"); + include("../../footer.html"); + ?> + + \ No newline at end of file diff --git a/www/public/Moment-2/Upg2/räknare.php b/www/public/Moment-2/Upg2/räknare.php new file mode 100644 index 0000000..d584fc6 --- /dev/null +++ b/www/public/Moment-2/Upg2/räknare.php @@ -0,0 +1,16 @@ + + + + + + Document + + + + + \ No newline at end of file diff --git a/www/public/Moment-2/Upg3/foreacharray.php b/www/public/Moment-2/Upg3/foreacharray.php new file mode 100644 index 0000000..bef752a --- /dev/null +++ b/www/public/Moment-2/Upg3/foreacharray.php @@ -0,0 +1,19 @@ + + + + + + Document + + + Välkommen"; + $page["main"] = "

Detta är innehållet på min sida

"; + $page["footer"] = "

Min sidfoot

"; + foreach($page as $key => $value) { + echo($key . ":" . $value . "
"); + } + include("../../footer.html"); + ?> + + \ No newline at end of file diff --git a/www/public/Moment-2/Upg4/beräkning.php b/www/public/Moment-2/Upg4/beräkning.php new file mode 100644 index 0000000..dbb81e9 --- /dev/null +++ b/www/public/Moment-2/Upg4/beräkning.php @@ -0,0 +1,26 @@ + + + + + + Document + + +"; + echo "Differansen av 4 och 1 är $sum
"; + echo "Produkten av 2 och 5 är $prod
"; + echo "Kvoten av 2 och 5 är $divi"; + + include("../../footer.html"); +?> + + \ No newline at end of file diff --git a/www/public/Moment-2/Upg4/math.php b/www/public/Moment-2/Upg4/math.php new file mode 100644 index 0000000..2c8f0c2 --- /dev/null +++ b/www/public/Moment-2/Upg4/math.php @@ -0,0 +1,31 @@ + + + + + + Document + + + + + \ No newline at end of file diff --git a/www/public/Moment-2/index.php b/www/public/Moment-2/index.php new file mode 100644 index 0000000..78fb63f --- /dev/null +++ b/www/public/Moment-2/index.php @@ -0,0 +1,17 @@ + + + + + + Document + + + Upg1 + Upg2 + Upg3 + Upg4 + + + \ No newline at end of file diff --git a/www/public/index.php b/www/public/index.php index aa8fdb2..68839f6 100644 --- a/www/public/index.php +++ b/www/public/index.php @@ -8,5 +8,6 @@ Moment-0 Moment-1 + Moment-2 \ No newline at end of file From b1a7b646a63d421e44b9448d763317f4192f006c Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 30 Aug 2024 15:43:25 +0200 Subject: [PATCH 4/4] klar med moment 2 --- www/public/Moment-2/FeetBook/addUser.php | 48 +++++++++++++++++++ www/public/Moment-2/FeetBook/cleanData.php | 1 + www/public/Moment-2/FeetBook/start.php | 40 ++++++++++++++-- .../FeetBook/{Person.php => user.php} | 27 +++-------- www/public/Moment-2/index.php | 1 + www/user.dat | 0 6 files changed, 94 insertions(+), 23 deletions(-) create mode 100644 www/public/Moment-2/FeetBook/addUser.php rename www/public/Moment-2/FeetBook/{Person.php => user.php} (54%) create mode 100644 www/user.dat diff --git a/www/public/Moment-2/FeetBook/addUser.php b/www/public/Moment-2/FeetBook/addUser.php new file mode 100644 index 0000000..1f497f1 --- /dev/null +++ b/www/public/Moment-2/FeetBook/addUser.php @@ -0,0 +1,48 @@ + + + + + Filhantering Läs + + +getAnvändarnamn() == $användarnamn && $user->getLösenord() == $lösenord) { + echo('Välkommen ' . $user->getFörnamn() . " " . $user->getEfternamn()); + break; + } + } + } +?> + + \ No newline at end of file diff --git a/www/public/Moment-2/FeetBook/cleanData.php b/www/public/Moment-2/FeetBook/cleanData.php index 8a8ccf3..d80117c 100644 --- a/www/public/Moment-2/FeetBook/cleanData.php +++ b/www/public/Moment-2/FeetBook/cleanData.php @@ -15,6 +15,7 @@ } $data = strip_tags($data); + $data = htmlspecialchars($data); $data = trim($data); $data = stripslashes($data); return $data; diff --git a/www/public/Moment-2/FeetBook/start.php b/www/public/Moment-2/FeetBook/start.php index 65ae8a7..552269e 100644 --- a/www/public/Moment-2/FeetBook/start.php +++ b/www/public/Moment-2/FeetBook/start.php @@ -10,6 +10,7 @@
Sign up + @@ -18,12 +19,45 @@ - +
-
+ + +
+
+ Sign in + + + + + + +
+
+ \ No newline at end of file diff --git a/www/public/Moment-2/FeetBook/Person.php b/www/public/Moment-2/FeetBook/user.php similarity index 54% rename from www/public/Moment-2/FeetBook/Person.php rename to www/public/Moment-2/FeetBook/user.php index 8a02069..d72afa1 100644 --- a/www/public/Moment-2/FeetBook/Person.php +++ b/www/public/Moment-2/FeetBook/user.php @@ -1,22 +1,11 @@ - - - - - - Document - - - förnamn = $förnamn; $this->efternamn = $efternamn; @@ -24,26 +13,24 @@ class Person { $this->lösenord = $lösenord; } - public function getförnamn() { + public function getFörnamn() { return $this->förnamn; } - public function getefternamn() { + public function getEfternamn() { return $this->efternamn; } - public function getanvändarnamn() { + public function getAnvändarnamn() { return $this->användarnamn; } - public function getlösenord() { + public function getLösenord() { return $this->lösenord; } - public function setlösenord($lösenord) { + public function setLösenord($lösenord) { $this->lösenord = $lösenord; } } ?> - - \ No newline at end of file diff --git a/www/public/Moment-2/index.php b/www/public/Moment-2/index.php index 78fb63f..efbbb8d 100644 --- a/www/public/Moment-2/index.php +++ b/www/public/Moment-2/index.php @@ -10,6 +10,7 @@ Upg2 Upg3 Upg4 + FeetBook diff --git a/www/user.dat b/www/user.dat new file mode 100644 index 0000000..e69de29