-
Notifications
You must be signed in to change notification settings - Fork 0
/
trip-mini.php
86 lines (82 loc) · 2.89 KB
/
trip-mini.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
include("connection.php");
if ($_SERVER["REQUEST_METHOD"] == "POST" ) {
$username=$_POST['username'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$location = $_POST['location'];
$nopeople = $_POST['nopeople'];
$startdate = $_POST['startdate'];
try {
$stmt = $pdo->prepare("INSERT INTO preplan (username, email, phone,location,nopeople,startdate) VALUES (?, ?, ?,?, ?, ?)");
$stmt->bindParam(1, $username);
$stmt->bindParam(2, $email);
$stmt->bindParam(3, $phone);
$stmt->bindParam(4, $location);
$stmt->bindParam(5, $nopeople);
$stmt->bindParam(6, $startdate);
$stmt->execute();
$_SESSION['user_id'] = $pdo->lastInsertId();
$_SESSION['username'] = $username;
header("Location: details-mini.php");
} catch (PDOException $e) {
echo "Error: " . $e->getMessage();
}
}
?>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>signin</title>
<link rel="stylesheet" href="sign-mini.css">
</head>
<body>
<div class="header">
<nav>
<p1>ExploreEase </p1>
<ul class="nav-links">
<li><a href="home-mini.php">Home</a></li>
<li><a href="about-mini.php">Contact Us</a></li>
<li><a href="review-mini.php">Reviwes</a></li>
</ul>
<a href="sign_in.php" class="register-btn">register</a>
</nav>
</div>
<div class="wrapper">
<div class="title">
Plan A Trip
</div>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?> " >
<div class="field">
<input type="text" name="username" required>
<label>Name</label>
</div>
<div class="field">
<input type="email" name="email" required>
<label>Email Address</label>
</div>
<div class="field">
<input type="text" name="phone" required>
<label>Phone No</label>
</div>
<div class="field">
<input type="text" name="location" required>
<label>Select Location</label>
</div>
<div class="field">
<input type="text" name="nopeople" required>
<label>No of people</label>
</div>
<div class="field">
<input type="text" name="startdate" required>
<label>Start date(app)</label>
</div>
<div class="field">
<input type="submit" value="Submit">
</div>
</form>
</div>
</div>
</body>
</html>