From 6c95701c353a526ace3ea7997b6d23dcb44cbdfc Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 14 Jan 2026 15:33:39 -0500 Subject: [PATCH 01/23] first --- 02/index.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/02/index.php b/02/index.php index f953398..0243880 100644 --- a/02/index.php +++ b/02/index.php @@ -1,16 +1,36 @@ + Hello, my name is " . $firstName . " " . $lastname . "

"; +if ($isStudent) { + echo "

I am a student

"; +} else { + echo "

I am not a student.

"; +} //4. Loosely Typed Language Demo +$num1 = 1; +$num2 = 10; + +function add(int $num1,int $num2) : int { + return $num1 + $num2; +} + +echo "

" . add($num1, $num2) . "

"; //5. Strict Types & Types Hints -//6. OOP with PHP +//6. OOP with PHP From 1f57adf59456373d3700ef110a81e8dfbcb57d1d Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 14 Jan 2026 15:34:08 -0500 Subject: [PATCH 02/23] first --- test.php | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test.php diff --git a/test.php b/test.php new file mode 100644 index 0000000..61ace19 --- /dev/null +++ b/test.php @@ -0,0 +1,2 @@ + Date: Wed, 14 Jan 2026 16:00:38 -0500 Subject: [PATCH 03/23] Delete test.php --- test.php | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 test.php diff --git a/test.php b/test.php deleted file mode 100644 index 61ace19..0000000 --- a/test.php +++ /dev/null @@ -1,2 +0,0 @@ - Date: Wed, 14 Jan 2026 16:34:07 -0500 Subject: [PATCH 04/23] lab-1 --- 02/index.php | 2 +- assignments/labs/lab_one/car.php | 22 ++++++++++++++++++++++ assignments/labs/lab_one/footer.php | 1 + assignments/labs/lab_one/index.php | 10 +++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 assignments/labs/lab_one/car.php diff --git a/02/index.php b/02/index.php index 0243880..960f2f5 100644 --- a/02/index.php +++ b/02/index.php @@ -3,7 +3,7 @@ //1. Set Up & Start -//2. Code Commenting +//2. Code Commenting // inline comment //3. Variables, Data Types, Concatenation, Conditional Statements & Echo diff --git a/assignments/labs/lab_one/car.php b/assignments/labs/lab_one/car.php new file mode 100644 index 0000000..46b9086 --- /dev/null +++ b/assignments/labs/lab_one/car.php @@ -0,0 +1,22 @@ +make = $make; + $this->model = $model; + $this->year = $year; + } + + // Method to get car details + public function getDetails(): string { + return "Car Details: " . $this->year . " " . $this->make . " " . $this->model; + } + +} \ No newline at end of file diff --git a/assignments/labs/lab_one/footer.php b/assignments/labs/lab_one/footer.php index 78e2b2b..fd8438f 100644 --- a/assignments/labs/lab_one/footer.php +++ b/assignments/labs/lab_one/footer.php @@ -1,3 +1,4 @@ + Follow the instructions outlined in instructions.txt to complete this lab. Good luck & have fun!😀

"; -require "footer.php"; \ No newline at end of file +echo "

Car Details: " . $car->getDetails() . "

"; + +require "footer.php"; \ No newline at end of file From 4976aae8839cb01cae185dec11bff8f995abf276 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 15 Jan 2026 17:11:05 -0500 Subject: [PATCH 05/23] lab one complete --- assignments/labs/lab_one/car.php | 6 +++--- assignments/labs/lab_one/connect.php | 21 +++++++++++++++++++++ assignments/labs/lab_one/index.php | 23 +++++++++++++++++++++-- 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 assignments/labs/lab_one/connect.php diff --git a/assignments/labs/lab_one/car.php b/assignments/labs/lab_one/car.php index 46b9086..39fde42 100644 --- a/assignments/labs/lab_one/car.php +++ b/assignments/labs/lab_one/car.php @@ -1,4 +1,5 @@ -year . " " . $this->make . " " . $this->model; + return $this->year . " " . $this->make . " " . $this->model; } - } \ No newline at end of file diff --git a/assignments/labs/lab_one/connect.php b/assignments/labs/lab_one/connect.php new file mode 100644 index 0000000..3ab3604 --- /dev/null +++ b/assignments/labs/lab_one/connect.php @@ -0,0 +1,21 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + // echo "Connected successfully"; // optional for testing +} catch (PDOException $e) { + // Display error message if connection fails + echo "Database connection failed: " . $e->getMessage(); + exit; +} diff --git a/assignments/labs/lab_one/index.php b/assignments/labs/lab_one/index.php index 825b075..2b293bb 100644 --- a/assignments/labs/lab_one/index.php +++ b/assignments/labs/lab_one/index.php @@ -1,12 +1,31 @@ Car: " . $car->getDetails() . "

"; + +// Output instructions message echo "

Follow the instructions outlined in instructions.txt to complete this lab. Good luck & have fun!😀

"; -echo "

Car Details: " . $car->getDetails() . "

"; +/* +Reflection: +I found creating the Car class and using require statements easy +because it followed examples from class. The most challenging part +was setting up the PDO database connection and making sure XAMPP +was configured correctly. +*/ + +// Include shared footer HTML require "footer.php"; \ No newline at end of file From b86133cc735c5ca611f1d3f208b94eeb164508e9 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 20:42:09 -0500 Subject: [PATCH 06/23] changes --- 02/index.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/02/index.php b/02/index.php index 7d72d4a..aa49b70 100644 --- a/02/index.php +++ b/02/index.php @@ -45,10 +45,6 @@ function add(int $num1,int $num2) : int { $num1 = 5; $num2 = "10"; -function add($num1, $num2) { - return $num1 + $num2; -} - echo "

" . add($num1, $num2) . "

"; //4. Strict Types & Types Hints From ec9179590993316eed9a4990dbff2b412f3a5e67 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 20:44:05 -0500 Subject: [PATCH 07/23] fix --- 02/index.php | 89 +++++++++------------------------------------------- 1 file changed, 14 insertions(+), 75 deletions(-) diff --git a/02/index.php b/02/index.php index bb3b725..aa49b70 100644 --- a/02/index.php +++ b/02/index.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD " . add($num1, $num2) . "

"; -======= ->>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 +echo "

Hello there, my name is " . $firstname . " " . $lastName . "

"; -echo "

Hello there, my name is ". $firstName . " ". $lastName ."

"; -if($isInstructor) { - echo "

I am your teacher.

"; -} -else { - echo "

Whoops, teach didn't show!

"; +if ($is_student === true) { + echo "

I am your teacher!

"; +} else { + echo "

Uh oh, teach didn't show!

"; } //3. PHP is loosely typed -//create two variables, one called num1 and one called num2, in num1 store an integer and in num2 store a number but treat as string "10" -$num1 = 10; //integer -$num2 = "10"; //string +$num1 = 5; +$num2 = "10"; -<<<<<<< HEAD echo "

" . add($num1, $num2) . "

"; -======= -//add type hints to make PHP less loosey goosey -/*function add(int $num1, int $num2) : int { - return $num1 + $num2; -} -echo "

" . add($num1,$num2) . "

"; ->>>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 +//4. Strict Types & Types Hints +/* Add declare(strict_types=1) and type hints +//strict types tell PHP not to automatically convert values when calling functions. Type hints tell PHP what to expect */ +/*function add(int $num1, int $num2): int { + return $num1 + $num2; +} +echo add($num1, $num2); */ -<<<<<<< HEAD //6. OOP with PHP -======= -// OOP with PHP { - -class Person { - public string $name; - public int $age; - public bool $isInstructor; - - public function __construct(string $name, int $age, bool $isInstructor) { - $this->name = $name; - $this->age = $age; - $this->isInstructor = $isInstructor; - } - - public function getBadge(): string { - $role = $this->isInstructor ? "Instructor" : "Student"; - return "Name : {$this->name} | Age: {$this->age} | Role : $role"; - } -} - -//create an instance of the object - -$person = new Person("Jessica", 40, true); - -echo $person->getBadge(); - - - - - - - - - ->>>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 From 276d3847a509d20fad3ea790b8004e40375fc3e4 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 22:25:18 -0500 Subject: [PATCH 08/23] Add initial files for lab_two including header, footer, nav, and data --- assignments/labs/lab_two/data.php | 6 ++++++ assignments/labs/lab_two/includes/footer.php | 6 ++++++ assignments/labs/lab_two/includes/header.php | 9 +++++++++ assignments/labs/lab_two/includes/nav.php | 5 +++++ assignments/labs/lab_two/index.php | 14 ++++++++++++++ 5 files changed, 40 insertions(+) create mode 100644 assignments/labs/lab_two/data.php create mode 100644 assignments/labs/lab_two/includes/footer.php create mode 100644 assignments/labs/lab_two/includes/header.php create mode 100644 assignments/labs/lab_two/includes/nav.php create mode 100644 assignments/labs/lab_two/index.php diff --git a/assignments/labs/lab_two/data.php b/assignments/labs/lab_two/data.php new file mode 100644 index 0000000..1610764 --- /dev/null +++ b/assignments/labs/lab_two/data.php @@ -0,0 +1,6 @@ + +

© 2026

+ + + + diff --git a/assignments/labs/lab_two/includes/header.php b/assignments/labs/lab_two/includes/header.php new file mode 100644 index 0000000..e7bf5b3 --- /dev/null +++ b/assignments/labs/lab_two/includes/header.php @@ -0,0 +1,9 @@ + + + + + <?= $title ?> + + + +

diff --git a/assignments/labs/lab_two/includes/nav.php b/assignments/labs/lab_two/includes/nav.php new file mode 100644 index 0000000..687eb96 --- /dev/null +++ b/assignments/labs/lab_two/includes/nav.php @@ -0,0 +1,5 @@ + diff --git a/assignments/labs/lab_two/index.php b/assignments/labs/lab_two/index.php new file mode 100644 index 0000000..d7b53e5 --- /dev/null +++ b/assignments/labs/lab_two/index.php @@ -0,0 +1,14 @@ + + + + + + + From 0264cfc7e6750a932f5e575c0df569a02aa3fe2f Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Fri, 30 Jan 2026 14:08:12 -0500 Subject: [PATCH 09/23] Add contact form and processing logic with validation and email functionality --- assignments/labs/lab_three/index.php | 94 +++++++++++++++ assignments/labs/lab_three/process.php | 154 +++++++++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 assignments/labs/lab_three/index.php create mode 100644 assignments/labs/lab_three/process.php diff --git a/assignments/labs/lab_three/index.php b/assignments/labs/lab_three/index.php new file mode 100644 index 0000000..41aa15b --- /dev/null +++ b/assignments/labs/lab_three/index.php @@ -0,0 +1,94 @@ + + + + + + Contact Form + + + + + + + +
+ +

Contact Form

+

All fields are required.

+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + + +
+
+ + + \ No newline at end of file diff --git a/assignments/labs/lab_three/process.php b/assignments/labs/lab_three/process.php new file mode 100644 index 0000000..a4d0e50 --- /dev/null +++ b/assignments/labs/lab_three/process.php @@ -0,0 +1,154 @@ + 40) $errors[] = "First name is too long."; +if (strlen($lastName) > 40) $errors[] = "Last name is too long."; +if (strlen($email) > 80) $errors[] = "Email is too long."; +if (strlen($message) > 1000) $errors[] = "Message is too long."; + +// Email format validation +if ($email !== "" && !filter_var($email, FILTER_VALIDATE_EMAIL)) { + $errors[] = "Email address is not valid."; +} + +// ------------------------------------ +// Display errors if validation fails +// ------------------------------------ +if (!empty($errors)) { + ?> + + + + + Form Error + + + +
+
+

Please fix the following:

+ +
+ Go back +
+ + + + + + + + Form Submitted + + + +
+ +
+

Submission received

+

Your form was successfully submitted.

+
+ + +

First Name:

+

Last Name:

+

Email:

+

Message:

+ + + +
Email was sent successfully.
+ +
+ Email could not be sent (common on local servers). +
+ + + Submit another message + +
+ + From aa5f72a398ac04ea9eca134f08bf1206d121f653 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Fri, 30 Jan 2026 14:08:19 -0500 Subject: [PATCH 10/23] Fix syntax error in database connection error handling --- 03/02_fix_this_code/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03/02_fix_this_code/index.php b/03/02_fix_this_code/index.php index 19aa44c..e38da09 100644 --- a/03/02_fix_this_code/index.php +++ b/03/02_fix_this_code/index.php @@ -21,4 +21,4 @@ catch (PDOException $e { echo "Database error: " . $e -} +} \ No newline at end of file From 505e01a7203b335322e77c3a047ae20be1e17e28 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Fri, 13 Feb 2026 23:37:23 -0500 Subject: [PATCH 11/23] Add database connection script in connect.php --- assignments/labs/lab_four/includes/connect.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 assignments/labs/lab_four/includes/connect.php diff --git a/assignments/labs/lab_four/includes/connect.php b/assignments/labs/lab_four/includes/connect.php new file mode 100644 index 0000000..d063fe7 --- /dev/null +++ b/assignments/labs/lab_four/includes/connect.php @@ -0,0 +1,7 @@ + PDO::ERRMODE_EXCEPTION] +); \ No newline at end of file From 8ecbd87e11d9424b7e257d1b9b83e9aa3a16fea5 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Fri, 13 Feb 2026 23:37:33 -0500 Subject: [PATCH 12/23] Refactor process.php and subscribers.php to implement database insertion and retrieval logic --- assignments/labs/lab_four/process.php | 32 ++++++++++++++++------- assignments/labs/lab_four/subscribers.php | 20 +++++++++++--- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/assignments/labs/lab_four/process.php b/assignments/labs/lab_four/process.php index 4dd4476..16ce15f 100644 --- a/assignments/labs/lab_four/process.php +++ b/assignments/labs/lab_four/process.php @@ -1,17 +1,30 @@ prepare(" + INSERT INTO subscribers (first_name, last_name, email) + VALUES (:first_name, :last_name, :email) +"); + +$STMT->execute([ + ":first_name" => $FIRST_NAME, + ":last_name" => $LAST_NAME, + ":email" => $EMAIL +]); ?> @@ -28,13 +41,14 @@

Thank You for Subscribing

- - +

+ Thanks, ! + You have been added to our mailing list. +

View Subscribers

- - \ No newline at end of file + diff --git a/assignments/labs/lab_four/subscribers.php b/assignments/labs/lab_four/subscribers.php index ff6bbf0..c38e245 100644 --- a/assignments/labs/lab_four/subscribers.php +++ b/assignments/labs/lab_four/subscribers.php @@ -1,5 +1,4 @@ prepare(" + SELECT id, first_name, last_name, email, subscribed_at + FROM subscribers + ORDER BY subscribed_at DESC +"); + +$STMT->execute(); +$subscribers = $STMT->fetchAll(); ?>
@@ -31,7 +37,15 @@ - + + + + + + + + + From 96bda89917c8fe5fb321664430a0e3a562366526 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Fri, 13 Feb 2026 23:45:44 -0500 Subject: [PATCH 13/23] Remove footer inclusion from subscribers.php and adjust formatting --- assignments/labs/lab_four/subscribers.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/assignments/labs/lab_four/subscribers.php b/assignments/labs/lab_four/subscribers.php index c38e245..e5b7bd4 100644 --- a/assignments/labs/lab_four/subscribers.php +++ b/assignments/labs/lab_four/subscribers.php @@ -53,6 +53,4 @@

Back to Subscribe Form

-
- - + \ No newline at end of file From 19a7482503bba56dceb82f65088c809c62fbfa25 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Sun, 15 Feb 2026 15:24:43 -0500 Subject: [PATCH 14/23] Update email recipient and fix header injection vulnerability in process.php --- assignments/labs/lab_three/process.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/assignments/labs/lab_three/process.php b/assignments/labs/lab_three/process.php index a4d0e50..4c15bb6 100644 --- a/assignments/labs/lab_three/process.php +++ b/assignments/labs/lab_three/process.php @@ -93,7 +93,7 @@ function safe(string $value): string { // ------------------------------------ // Send email // ------------------------------------ -$to = "info@example.com"; // Replace with instructor-required email +$to = "webdev992@gmail.com"; // Updated to actual email $subject = "New Contact Form Submission"; // Build email message @@ -103,12 +103,14 @@ function safe(string $value): string { "Email: {$email}\n\n" . "Message:\n{$message}\n"; -// Email headers -$headers = "Reply-To: {$email}\r\n"; +// Email headers - Fixed header injection vulnerability +$safeEmail = str_replace(["\r", "\n"], '', $email); // Remove newlines to prevent header injection +$headers = "From: noreply@bakeittilyoumakeit.com\r\n"; +$headers .= "Reply-To: {$safeEmail}\r\n"; $headers .= "Content-Type: text/plain; charset=UTF-8"; // Attempt to send email -$mailSent = @mail($to, $subject, $body, $headers); +$mailSent = mail($to, $subject, $body, $headers); // ------------------------------------ // Confirmation page @@ -151,4 +153,4 @@ function safe(string $value): string { - + \ No newline at end of file From 6fadca18502b06356c5daebcfc077674620105e3 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 19:41:00 -0500 Subject: [PATCH 15/23] Add initial task management files: add_task.php, db.php, delete_task.php, edit_task.php, and index.php --- timetracker/add_task.php | 0 timetracker/db.php | 0 timetracker/delete_task.php | 0 timetracker/edit_task.php | 0 timetracker/index.php | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 timetracker/add_task.php create mode 100644 timetracker/db.php create mode 100644 timetracker/delete_task.php create mode 100644 timetracker/edit_task.php create mode 100644 timetracker/index.php diff --git a/timetracker/add_task.php b/timetracker/add_task.php new file mode 100644 index 0000000..e69de29 diff --git a/timetracker/db.php b/timetracker/db.php new file mode 100644 index 0000000..e69de29 diff --git a/timetracker/delete_task.php b/timetracker/delete_task.php new file mode 100644 index 0000000..e69de29 diff --git a/timetracker/edit_task.php b/timetracker/edit_task.php new file mode 100644 index 0000000..e69de29 diff --git a/timetracker/index.php b/timetracker/index.php new file mode 100644 index 0000000..e69de29 From b504505616753c4a351f2ee1002604fc5a3171ff Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 19:41:39 -0500 Subject: [PATCH 16/23] Add database connection script in db.php --- timetracker/db.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/timetracker/db.php b/timetracker/db.php index e69de29..2b076ac 100644 --- a/timetracker/db.php +++ b/timetracker/db.php @@ -0,0 +1,16 @@ + \ No newline at end of file From f1574627dfd8beccd1b6c5cdbe2e620d81736eb3 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 20:32:51 -0500 Subject: [PATCH 17/23] Add task display functionality to index.php --- timetracker/index.php | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/timetracker/index.php b/timetracker/index.php index e69de29..9545c5b 100644 --- a/timetracker/index.php +++ b/timetracker/index.php @@ -0,0 +1,63 @@ + + + + + + + Time Tracker + + + + + +
+

Time Tracker

+ + + + Add Task + + + + + + + + + + + + + + + 0): ?> + + + + + + + + + + + + + + + + +
Task NameCategoryPriorityDue DateTime Spent (hrs)Actions
+ Edit + Delete +
No tasks found. Add one!
+
+ + + \ No newline at end of file From efeddd19d66de51c96b187dce95c8cbc1599668c Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 21:32:58 -0500 Subject: [PATCH 18/23] Implement task editing functionality with server-side validation in edit_task.php --- timetracker/edit_task.php | 134 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/timetracker/edit_task.php b/timetracker/edit_task.php index e69de29..db866ab 100644 --- a/timetracker/edit_task.php +++ b/timetracker/edit_task.php @@ -0,0 +1,134 @@ + + + + + + + Edit Task + + + + +
+

Edit Task

+ + + +
+ +

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + Cancel + + +
+
+ + + \ No newline at end of file From 3978f0b2029a37af4d6def1bc3d554f7fc06b1f2 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 21:33:15 -0500 Subject: [PATCH 19/23] Implement task deletion functionality in delete_task.php --- timetracker/delete_task.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/timetracker/delete_task.php b/timetracker/delete_task.php index e69de29..92beff1 100644 --- a/timetracker/delete_task.php +++ b/timetracker/delete_task.php @@ -0,0 +1,18 @@ + \ No newline at end of file From 992fb23f569dce928360b75a6d4fa2f171a31d3f Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Tue, 17 Feb 2026 23:27:27 -0500 Subject: [PATCH 20/23] Implement task addition functionality with server-side validation in add_task.php --- timetracker/add_task.php | 112 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/timetracker/add_task.php b/timetracker/add_task.php index e69de29..f0f3dea 100644 --- a/timetracker/add_task.php +++ b/timetracker/add_task.php @@ -0,0 +1,112 @@ + + + + + + + Add Task + + + + +
+

Add New Task

+ + + +
+ +

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + Cancel + + +
+
+ + + \ No newline at end of file From 4d28cf61073a90a09eb9cbf63689f5ea07bbfbac Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 18 Feb 2026 00:02:24 -0500 Subject: [PATCH 21/23] Add reCAPTCHA verification to task submission form in add_task.php --- timetracker/add_task.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/timetracker/add_task.php b/timetracker/add_task.php index f0f3dea..9fd31df 100644 --- a/timetracker/add_task.php +++ b/timetracker/add_task.php @@ -22,6 +22,17 @@ if ($_POST['time_spent'] === "" || !is_numeric($_POST['time_spent'])) { $errors[] = "Time spent must be a number."; } + // Verify reCAPTCHA + if (empty($_POST['g-recaptcha-response'])) { + $errors[] = "Please complete the reCAPTCHA."; + } else { + $secret = "YOUR_SECRET_KEY_HERE"; + $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=" . $_POST['g-recaptcha-response']); + $responseData = json_decode($response); + if (!$responseData->success) { + $errors[] = "reCAPTCHA verification failed. Please try again."; + } + } // If no errors, insert into database if (empty($errors)) { @@ -51,6 +62,8 @@ Add Task + + @@ -102,6 +115,11 @@ value=""> + +
+
+
+ Cancel From ab4fff3cff354c947d2bb6a876bfa19504df531f Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 18 Feb 2026 00:05:19 -0500 Subject: [PATCH 22/23] Update reCAPTCHA secret keys in add_task.php --- timetracker/add_task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timetracker/add_task.php b/timetracker/add_task.php index 9fd31df..7875235 100644 --- a/timetracker/add_task.php +++ b/timetracker/add_task.php @@ -26,7 +26,7 @@ if (empty($_POST['g-recaptcha-response'])) { $errors[] = "Please complete the reCAPTCHA."; } else { - $secret = "YOUR_SECRET_KEY_HERE"; + $secret = "6LeCfG8sAAAAAGkFqfwxrmU0VoN18VtvtEhDDDFi"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=" . $_POST['g-recaptcha-response']); $responseData = json_decode($response); if (!$responseData->success) { @@ -117,7 +117,7 @@
-
+
Cancel From 9d4b6e7ace9f317984cb89dca1b6b670bd966fcc Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 18 Feb 2026 00:41:23 -0500 Subject: [PATCH 23/23] Update database connection settings in db.php --- timetracker/db.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/timetracker/db.php b/timetracker/db.php index 2b076ac..cc16a91 100644 --- a/timetracker/db.php +++ b/timetracker/db.php @@ -1,13 +1,12 @@