Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "myDB";
- $firstname = "";
- $lastname = "";
- $email = "";
- $country = "";
- $mobile = "";
- $password = "";
- $touristId = "";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- $hotelname = $_POST["dhotelname"];
- $hoteladdress = $_POST["dhoteladdress"];
- $hotelcontact = $_POST["dhotelcontact"];
- $hotelcharges = $_POST["dhotelcharges"];
- $hotelnearestrail = $_POST["dhotelnearestrail"];
- $hotelnearestair = $_POST["dhotelnearestair"];
- var_dump($mobile);
- // Create database
- $sql = "INSERT INTO hotel (hotel_name, contact_no, address, charges,nearest_rail,nearest_air)
- VALUES ('$hotelname', '$hotelcontact', '$hoteladdress', '$hotelcharges', '$hotelnearestrail','$hotelnearestair')";
- if ($conn->query($sql) === TRUE) {
- header("Location:welcome.php");
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment