we going places
This commit is contained in:
parent
734f47008f
commit
bf592b16fb
49
www/public/Moment-2/FeetBook/Person.php
Normal file
49
www/public/Moment-2/FeetBook/Person.php
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
class Person {
|
||||
|
||||
private $förnamn;
|
||||
private $efternamn;
|
||||
private $användarnamn;
|
||||
private $lösenord;
|
||||
|
||||
/**
|
||||
* Person konstruktor.
|
||||
*/
|
||||
public function __construct($förnamn, $efternamn, $användarnamn, $lösenord) {
|
||||
$this->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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
24
www/public/Moment-2/FeetBook/cleanData.php
Normal file
24
www/public/Moment-2/FeetBook/cleanData.php
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
function cleanData($data) {
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
if(!mb_check_encoding($data)){
|
||||
header('Location: start.php');
|
||||
}
|
||||
|
||||
$data = strip_tags($data);
|
||||
$data = trim($data);
|
||||
$data = stripslashes($data);
|
||||
return $data;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
29
www/public/Moment-2/FeetBook/start.php
Normal file
29
www/public/Moment-2/FeetBook/start.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FeetBook</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>FeetBook</h1>
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<legend>Sign up</legend>
|
||||
<label>Skriv förnamn</label>
|
||||
<input type="text" name="förnamn">
|
||||
<label>Skriv efternamn</label>
|
||||
<input type="text" name="efternamn">
|
||||
<label>Skriv användarnamn</label>
|
||||
<input type="text" name="användarnamn">
|
||||
<label>Skriv lösenord</label>
|
||||
<input type="text" name="lösenord">
|
||||
<input type="submit" value="signUp">
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php
|
||||
include('cleanData.php');
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
16
www/public/Moment-2/Upg1/strip_tag.php
Normal file
16
www/public/Moment-2/Upg1/strip_tag.php
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
echo strip_tags("Hello <strong>World<strong><br>", "<strong><br>");
|
||||
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");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
16
www/public/Moment-2/Upg2/räknare.php
Normal file
16
www/public/Moment-2/Upg2/räknare.php
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
for($räknare = 1.0; $räknare < 5; $räknare+=0.1) {
|
||||
echo($räknare. " ");
|
||||
}
|
||||
include("../../footer.html");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
19
www/public/Moment-2/Upg3/foreacharray.php
Normal file
19
www/public/Moment-2/Upg3/foreacharray.php
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$page["head"] = "<h1>Välkommen</h1>";
|
||||
$page["main"] = "<p>Detta är innehållet på min sida</p>";
|
||||
$page["footer"] = "<hr><p>Min sidfoot</p>";
|
||||
foreach($page as $key => $value) {
|
||||
echo($key . ":" . $value . "<br>");
|
||||
}
|
||||
include("../../footer.html");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
26
www/public/Moment-2/Upg4/beräkning.php
Normal file
26
www/public/Moment-2/Upg4/beräkning.php
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include('math.php');
|
||||
|
||||
$summa = sum(2, 5);
|
||||
$sum = subtract(4, 1);
|
||||
$prod = multiply(2, 5);
|
||||
$divi = division(6, 2);
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo "Summan av 2 och 5 är $summa<br>";
|
||||
echo "Differansen av 4 och 1 är $sum<br>";
|
||||
echo "Produkten av 2 och 5 är $prod<br>";
|
||||
echo "Kvoten av 2 och 5 är $divi";
|
||||
|
||||
include("../../footer.html");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
31
www/public/Moment-2/Upg4/math.php
Normal file
31
www/public/Moment-2/Upg4/math.php
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
function sum($t1, $t2){
|
||||
$sum = $t1 + $t2;
|
||||
return $sum;
|
||||
}
|
||||
|
||||
function subtract($t1, $t2){
|
||||
$sum = $t1 - $t2;
|
||||
return $sum;
|
||||
}
|
||||
|
||||
function multiply($t1, $t2){
|
||||
$prod = $t1 * $t2;
|
||||
return $prod;
|
||||
}
|
||||
|
||||
function division($t1, $t2){
|
||||
$divi = $t1 / $t2;
|
||||
return $divi;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
17
www/public/Moment-2/index.php
Normal file
17
www/public/Moment-2/index.php
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="Upg1/strip_tag.php">Upg1</a>
|
||||
<a href="Upg2/räknare.php">Upg2</a>
|
||||
<a href="Upg3/foreacharray.php">Upg3</a>
|
||||
<a href="Upg4/beräkning.php">Upg4</a>
|
||||
<?php
|
||||
include("../footer.html");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -8,5 +8,6 @@
|
||||
<body>
|
||||
<a href="Moment-0/index.php">Moment-0</a>
|
||||
<a href="Moment-1/index.php">Moment-1</a>
|
||||
<a href="Moment-2/index.php">Moment-2</a>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user