-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_vehicle.php
67 lines (59 loc) · 1.67 KB
/
add_vehicle.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="UTF-8">
<meta http-equiv="refresh" content="3; url=add_info.php">
<title>Vehicle Rental System : HomePage</title>
<script src="vrs.js"></script>
<link rel="stylesheet" type="text/css" href="vrs.css"/>
</head>
<body>
<div id="div1">
<img id="logo" src="logo.jpg" height="200" width="300" alt="vehicle rental system">
<header>
<h1>Vehicle Rental System</h1>
</header>
<hr>
</div>
<a class="orderlink" href="order_history.html">Order History</a>
<a class="defaultlink" href="default.html">Home</a>
<nav id="navigation">
<a href="add_info.php">Add New Vehicle</a> |
<a href="create_db.php">Create Database</a> |
<a href="general.html">General</a> |
<a href="special.html">Special</a> |
<a href="remove_vehicle.php">Remove Vehicle</a> |
</nav>
<main id="main1">
<?php
$servername = "localhost";
$username = "root";
$password = "system";
$dbname = "vrsDB";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// sql to create table
$sql = "CREATE TABLE MyGuests (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table MyGuests created successfully";
} else {
echo "Error creating table: " . $conn->error;
}
$cat=$_POST['category'];
$v_make=$_POST['v_make'];
$v_name=$_POST['v_name'];
echo $v_make." ".$v_name." added to the database.<br>";
?>
</main>
</body>
</html>