diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..b179ee3
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1 @@
+/* Custom Styles */
\ No newline at end of file
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..8c84b99
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1 @@
+// Custom Scripts
\ No newline at end of file
diff --git a/db/config.php b/db/config.php
index cc9229f..14bf3d8 100644
--- a/db/config.php
+++ b/db/config.php
@@ -1,17 +1,6 @@
PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- ]);
- }
- return $pdo;
-}
+define('DB_NAME', 'coursehub');
+define('DB_USER', 'root');
+define('DB_PASS', 'root');
+?>
\ No newline at end of file
diff --git a/db/db.php b/db/db.php
new file mode 100644
index 0000000..649f3d4
--- /dev/null
+++ b/db/db.php
@@ -0,0 +1,17 @@
+ PDO::ERRMODE_EXCEPTION,
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
+ PDO::ATTR_EMULATE_PREPARES => false,
+ ];
+ try {
+ return new PDO($dsn, DB_USER, DB_PASS, $options);
+ } catch (PDOException $e) {
+ throw new PDOException($e->getMessage(), (int)$e->getCode());
+ }
+}
+?>
\ No newline at end of file
diff --git a/db/migrations/001_create_providers_table.sql b/db/migrations/001_create_providers_table.sql
new file mode 100644
index 0000000..1c34526
--- /dev/null
+++ b/db/migrations/001_create_providers_table.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS providers (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ provider_name VARCHAR(255) NOT NULL,
+ contact_name VARCHAR(255) NOT NULL,
+ email VARCHAR(255) NOT NULL UNIQUE,
+ password VARCHAR(255) NOT NULL,
+ status VARCHAR(50) NOT NULL DEFAULT 'pending',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
diff --git a/index.php b/index.php
index 7205f3d..3b83c74 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,9 @@
-
-$phpVersion = PHP_VERSION;
-$now = date('Y-m-d H:i:s');
-?>
-
-
-
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
-
-
-
-
-
+
+
Welcome to coursehub
+
The best place to find and offer courses.
+
Register as a Provider
+
+
+
\ No newline at end of file
diff --git a/register.php b/register.php
new file mode 100644
index 0000000..21610ac
--- /dev/null
+++ b/register.php
@@ -0,0 +1,105 @@
+prepare($sql);
+ $stmt->execute([$email]);
+ if ($stmt->fetch()) {
+ $errors[] = 'Email already exists.';
+ } else {
+ $sql = "INSERT INTO providers (provider_name, contact_name, email, password) VALUES (?, ?, ?, ?)";
+ $stmt = $pdo->prepare($sql);
+ $hashed_password = password_hash($password, PASSWORD_DEFAULT);
+ $stmt->execute([$provider_name, $contact_name, $email, $hashed_password]);
+ $success = true;
+ }
+ } catch (PDOException $e) {
+ $errors[] = 'Database error: ' . $e->getMessage();
+ }
+ }
+}
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+ Registration successful! Your account is pending approval.
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/footer.php b/templates/footer.php
new file mode 100644
index 0000000..51f2f04
--- /dev/null
+++ b/templates/footer.php
@@ -0,0 +1,5 @@
+
+
+
+