2025-06-06 17:14:52 +08:00

32 lines
1.0 KiB
PHP

<html>
<head>
<title>Search</title>
<script src="./iframe.js"></script>
<link rel="stylesheet" href="search.css" type="text/css" />
</head>
<body>
<br><br><br><br><br><br><br><br>
<div style="position: sticky;">
<input type="text" id="search" placeholder="search any fruit you want"
oninput="searchDB()">
</div>
<script>
var existence = document.getElementById("search_window");
if (!existence) {
// Create the iframe and add it to the overlay div
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "./search_item.php");
iframe.id = "search_window";
document.body.appendChild(iframe);
}
function searchDB(){
var text = document.getElementById("search").value;
iframe.setAttribute("src", './search_item.php?text=' + text);
}
</script>
</body>
</html>