Bare opret en variabel for at gemme resultaterne i dette tilfælde dens $data. Flyt din include searchdata.php til bunden af koden, så den kan genkende $data. Gentag det derefter på din HTML-side.
html-side
<div>
<form action="Searchdata.php" method="post">
<input type="text" name="search" placeholder="Search">
<input type="submit" value="Search">
</form>
<div><?php echo $data ?></div>
</div>
PHP-koden.
<?php
include 'connect.php';
$data = '';
if(isset($_POST['submit'])){
$searchkey= $_POST['search'];
$searchkey=preg_replace("#[^0-9a-z]#i", "", $searchkey);
$query = mysqli_query($conn, "SELECT * FROM newentry WHERE Date LIKE '%$searchkey%'")or die("Could not search!");
$count = mysqli_num_rows($query);
if(!($count == 0)) {
while($row=mysqli_fetch_array($query)){
$Date=$row['Date'];
$Entry=$row['Entry'];
$data = '<div>'.$Date.'<br>'.$Entry.'</div>';
}
} else {
$data = "There was no search result!";}}
include 'Search.php';
?>