-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskills.php
53 lines (46 loc) · 1.3 KB
/
skills.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include 'db_config.php';
// Handle form submission to add a new skill
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['add'])) {
$skill_name = $_POST['skill_name'];
$proficiency = $_POST['proficiency'];
$sql = "INSERT INTO skills (skill_name, proficiency)
VALUES ('$skill_name', '$proficiency')";
if ($conn->query($sql) === TRUE) {
echo "New skill added successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
// Retrieve all skills
$sql = "SELECT * FROM skills";
$result = $conn->query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Skills</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>My Skills</h1>
<nav>
<a href="index.php">Home</a> |
<a href="education.php">Education</a> |
<a href="work_experience.php">Work Experience</a> |
<a href="skills.php">Skills</a> |
<a href="projects.php">Projects</a> |
<a href="contact.php">Contact</a>
</nav>
</header>
<section>
<h2>Add New Skill</h2>
<ul>
<li>HTML, CSS</li>
<li>C++</li>
</ul>
</section>
</body>
</html>