I have a pop up file in popup.html and I have a data.php file in root folder. When user click on submit then data.php is on form action. So I want to show modal. Html file when data.php echo command implement.
Baiscally i want to access modal.html file on the output of data.php.
modal.html
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="border-bottom:0px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<h4 class="text-center" style="font-size:30px;padding:30px;">Thank you for Booking!</h4><p Your booking has been confirmed. Please be present 10 minutes before your booking slot to avoid any inconvenience. </p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>
data.php
<?php
$servername = "localhost";
$username = "root";
$password = "xxx";
$dbname = "xxxx";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO data (name,phone,email,date,time)
VALUES ('$_POST[name]', '$_POST[phone]', '$_POST[email]', '$_POST[date]', '$_POST[time]')";
if (mysqli_query($conn, $sql)) {
echo "$(<modal.html)"
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
So I want to access the file on echo