<?php
$insert = false;
if (isset($_POST['name'])) { $server = "localhost";
$username = "root";
$password = "";
if (!$con) {
}
// echo "success connecting to the db";
$name = $_POST['name'];
$gender = $_POST['gender'];
$age = $_POST['age'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$desc = $_POST['desc'];
$sql = "INSERT INTO `trip`. `trip` (`name`, `age`, `gender`, `email`, `phone`, `desc`, `dt`) VALUES ('$name', '$age', '$gender', '$email', '$phone', '$desc', current_timestamp());";
// echo $sql;
if ($con->query($sql) === true) {
// echo "successfully inserted";
$insert = true;
} else {
echo "Error: $sql <br> $con->error";
}
$con->close();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Travel Us Trip</title>
<link rel="preconnect" href="https://f...content-available-to-author-only...s.com">
<link rel="preconnect" href="https://f...content-available-to-author-only...c.com" crossorigin>
<link href="https://f...content-available-to-author-only...s.com/css2?family=Rubik+Wet+Paint&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<img class="bg" src="bg.png" alt="iiit">
<div class="container">
<h1>Travel for Us Trip Form</h1>
<p>Hi, we are ready to go to the US!</p>
<?php
if ($insert == true) {
echo "<p class='submitmsg'>Thanks for submitting your form. We are happy to see you.</p>";
}
?>
<form action="index.php" method="post">
<input type="text" name="name" id="name" placeholder="Enter your name">
<input type="text" name="age" id="age" placeholder="Enter your age">
<input type="email" name="email" id="email" placeholder="Enter your email">
<input type="phone" name="phone" id="phone" placeholder="Enter your phone">
<textarea name="desc" id="desc" cols="30" rows="10" placeholder="Enter description of your trip"></textarea>
<button class="btn">Submit</button>
</form>
</div>
<script src="index.js"></script>
</body>
</html>
PD9waHAKJGluc2VydCA9IGZhbHNlOwoKaWYgKGlzc2V0KCRfUE9TVFsnbmFtZSddKSkgewogICAgJHNlcnZlciA9ICJsb2NhbGhvc3QiOwogICAgJHVzZXJuYW1lID0gInJvb3QiOwogICAgJHBhc3N3b3J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