summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-04-05 15:37:11 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-04-05 15:37:11 +0530
commit46d89228ed7a577628dc8c37c2e72161e39ec0a4 (patch)
tree8a6a688ee6a8edda064a1d526de237fa48ddc969 /php
parent5b6b5b62a0dfd4525db9a97a52634d1f8bb8e19c (diff)
Added PHP sample websiteHEADmaster
Diffstat (limited to 'php')
-rw-r--r--php/01-common-theme/common/footer.php5
-rw-r--r--php/01-common-theme/common/header.php19
-rw-r--r--php/01-common-theme/common/style.css57
-rw-r--r--php/01-common-theme/contact-process.php20
-rw-r--r--php/01-common-theme/contact.php35
-rw-r--r--php/01-common-theme/index.php12
6 files changed, 148 insertions, 0 deletions
diff --git a/php/01-common-theme/common/footer.php b/php/01-common-theme/common/footer.php
new file mode 100644
index 0000000..f01e7c1
--- /dev/null
+++ b/php/01-common-theme/common/footer.php
@@ -0,0 +1,5 @@
+ <footer class="main-footer">
+ Information Technology Center, University of Peradeniya, Sri Lanka
+ </footer>
+ </body>
+</html>
diff --git a/php/01-common-theme/common/header.php b/php/01-common-theme/common/header.php
new file mode 100644
index 0000000..83d762f
--- /dev/null
+++ b/php/01-common-theme/common/header.php
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Welcome! | CEIT Open Course Content</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link type="text/css" rel="stylesheet" media="all" href="/common/style.css" />
+ </head>
+ <body>
+ <header class="main-head">
+ <a href="/">CEIT Open Course Content</a>
+ </header>
+ <nav class="main-nav">
+ <ul>
+ <li><a href="/">Home</a></li>
+ <li><a href="/contact.php">Contact</a></li>
+ </ul>
+ </nav>
+
diff --git a/php/01-common-theme/common/style.css b/php/01-common-theme/common/style.css
new file mode 100644
index 0000000..48e53fb
--- /dev/null
+++ b/php/01-common-theme/common/style.css
@@ -0,0 +1,57 @@
+body {
+ font-size: 1.125em;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ line-height: 1.6em;
+ color: rgb(32, 34, 36);;
+ background-color: #FFF;
+ padding: 10px 5px;
+}
+
+
+.main-nav {
+ margin-top: 0;
+ padding: 0;
+}
+
+.main-nav ul {
+ margin: 0;
+ padding : 0;
+ list-style-type: none;
+ background-color: #F6F8F8;
+ border: 1px solid #eee;
+}
+
+.main-nav ul li {
+ margin-left: 0;
+ display: inline;
+ padding: 0 8px;
+ border-left: 1px solid #F9F9FF;
+ border-right: 1px solid #F9F9FF;
+}
+
+.main-nav ul li:hover {
+ background-color: white;
+ border-left: 1px solid #addfff;
+ border-right: 1px solid #addfff;
+}
+
+.main-nav ul li a {
+ color: #555;
+ font-weight: bold;
+}
+
+.main-nav ul li a:hover {
+ color: #000;
+ background-color: blue;
+}
+
+footer {
+ font-size: 80%;
+ border-top: solid 1px #000;
+}
+
+input, textarea {
+ display: block;
+ margin-bottom: 4px;
+}
+
diff --git a/php/01-common-theme/contact-process.php b/php/01-common-theme/contact-process.php
new file mode 100644
index 0000000..20181f8
--- /dev/null
+++ b/php/01-common-theme/contact-process.php
@@ -0,0 +1,20 @@
+<?php
+
+// Do the processing
+$subject = $_POST['subject'];
+$message = $_POST['message'];
+
+// Send an email
+// ...
+
+
+include "common/header.php";
+
+?>
+
+<p>Thank you! Your message with the subject "<?= htmlspecialchars($subject) ?>" was received successfully.</p>
+
+<?php
+
+include "common/footer.php";
+
diff --git a/php/01-common-theme/contact.php b/php/01-common-theme/contact.php
new file mode 100644
index 0000000..c5d8dae
--- /dev/null
+++ b/php/01-common-theme/contact.php
@@ -0,0 +1,35 @@
+<?php
+
+include "common/header.php";
+
+?>
+
+<style>
+
+textarea.message {
+ width: 300px;
+ height: 100px;
+}
+
+input.subject {
+ width: 300px;
+}
+
+</style>
+
+<form method="post" action="contact-process.php">
+
+Subject:
+ <input name="subject" class="subject" type="text"/>
+
+Body:
+ <textarea name="message" class="message"></textarea>
+
+ <input type="submit" value="Submit"/>
+
+</form>
+
+<?php
+
+include "common/footer.php";
+
diff --git a/php/01-common-theme/index.php b/php/01-common-theme/index.php
new file mode 100644
index 0000000..4da2e14
--- /dev/null
+++ b/php/01-common-theme/index.php
@@ -0,0 +1,12 @@
+<?php
+
+include "common/header.php";
+
+?>
+
+<p>This is the home page content.</p>
+
+<?php
+
+include "common/footer.php";
+