From 6f4cfe7b5c6c74d83b03e18870aeb6977db6c0de Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 28 Jun 2020 10:26:03 +0300 Subject: Did some tinkering with PHP and Javascript. --- Web design/PHP/Test/calc.php | 17 +++++ Web design/PHP/Test/footer.html | 1 + Web design/PHP/Test/header.php | 3 + Web design/PHP/Test/index.php | 155 ++++++++++++++++++++++++++++++++++++++++ Web design/PHP/Test/process.php | 13 ++++ 5 files changed, 189 insertions(+) create mode 100644 Web design/PHP/Test/calc.php create mode 100644 Web design/PHP/Test/footer.html create mode 100644 Web design/PHP/Test/header.php create mode 100644 Web design/PHP/Test/index.php create mode 100644 Web design/PHP/Test/process.php (limited to 'Web design/PHP') diff --git a/Web design/PHP/Test/calc.php b/Web design/PHP/Test/calc.php new file mode 100644 index 0000000..c2728d9 --- /dev/null +++ b/Web design/PHP/Test/calc.php @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/Web design/PHP/Test/footer.html b/Web design/PHP/Test/footer.html new file mode 100644 index 0000000..9d5e5c6 --- /dev/null +++ b/Web design/PHP/Test/footer.html @@ -0,0 +1 @@ +

Subscribe

diff --git a/Web design/PHP/Test/header.php b/Web design/PHP/Test/header.php new file mode 100644 index 0000000..73c6301 --- /dev/null +++ b/Web design/PHP/Test/header.php @@ -0,0 +1,3 @@ + diff --git a/Web design/PHP/Test/index.php b/Web design/PHP/Test/index.php new file mode 100644 index 0000000..00e4125 --- /dev/null +++ b/Web design/PHP/Test/index.php @@ -0,0 +1,155 @@ + + + + + + + + +
+ + +
+ Enter your name: + +
+ + "; + echo str_replace("Jo", "Mo", $workers[0]) . "
"; + echo substr($workers[0], 1, 1) . "
"; + } + + $staff = array("John", "Bob"); + doStuff($staff); + + foreach ($workers as $person) { + echo $person . ", "; + } + ?> + +
+ + "; + + $num = 0; + echo $num++; + echo $num; + + $num = 0; + echo ++$num; + ?> + +
+ +

Calculator

+ +
+ +
+ + + +
+ + + +
+ + + +
+ +
+ + + + + +
+ +
+ +
+ Blue:
+ Red:
+ Yellow:
+ +
+ + + +
+ + 31, "Alex" => 20); + + echo $ages["John"] . $ages["Alex"]; + ?> + +
+ + name = $personName; + $this->setAge($personAge); + } + + function setAge($age) { + if ($age < 0 || $age > 200) { + throw new Exception("Invalid age!", 1); + } + $this->age = $age; + } + + function getAge() { + return $this->age; + } + } + + class Worker extends Person { + + } + + $max = new Worker("Alex", 34); + + //$max->name = "Max"; + //$max->age = 22; + + echo $max->name, $max->getAge(); + ?> + + + + diff --git a/Web design/PHP/Test/process.php b/Web design/PHP/Test/process.php new file mode 100644 index 0000000..796b517 --- /dev/null +++ b/Web design/PHP/Test/process.php @@ -0,0 +1,13 @@ + + + + + + + + + + -- cgit v1.2.3