<script>
$('#searchBox').click(function(event) {
event.preventDefault();
var out = {
'searchCriteria': $('#search_criteria').val()
};
$.post('search.php', out,
function(data) {
$('.modal-body').html(data);
$(searchBoxModal).modal('show');
});
});
</script>
<div class="modal fade in" id="searchBoxModal" role="dialog" aria-labelledby="searchBoxTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="searchBoxLongTitle">Search Results...</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12" style="border:1px solid #ccc; box-shadow:5px 5px 3px #ccc; border-radius:10pt; padding:10px; width:85%; margin:auto;">
<table class="table">
<?php
$search = trim($_POST['searchCriteria']);
$querystate = "SELECT * from pages where body LIKE '%$search%' order by page_name";
$resultstate = mysqli_query($cxn, $querystate)
or die ("Couldn't execute query.");
while ($row=mysqli_fetch_assoc($resultstate))
{
?>
<tr>
<td style="width:75%;"><a href="../page.php?ID=<?php echo $row['id'];?>" target="_blank"><?php echo stripslashes($row['page_name']);?></a></td>
<td style="text-align:center; width:">
<div style="background-color:#ccc; border-radius:15px; margin:auto; width:82px; padding:5px; height:27px; border:1px solid #b7b6b6; box-shadow:3px 3px 1px #818080;">
<div style="border-radius:10px; margin:auto; text-align:center; width:72px; height:20px; margin-top:-2px; margin-left:-1px; background-color:#fff;
box-shadow:2px 2px 1px #606060 inset;">
<A HREF="page_display.php?ID=<?php echo $row['id']; ?>&Edit=Yes" style="font-size:10pt; text-decoration:none; color:#000; font-weight:bold;" >edit</a>
</div>
</div>
</td>
<td style="text-align:center;">
<div style="background-color:#ccc; border-radius:15px; margin:auto; width:82px; padding:5px; height:27px; border:1px solid #b7b6b6; box-shadow:3px 3px 1px #818080;">
<div style="border-radius:10px; margin:auto; text-align:center; width:72px; height:20px; margin-top:-2px; margin-left:-1px; background-color:#fff;
box-shadow:2px 2px 1px #606060 inset;">
<A HREF="page_display.php?ID=<?php echo $row['id']; ?>&Edit=No" style="font-size:10pt; text-decoration:none; color:#000; font-weight:bold;" >delete</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</table>
</div>
</div>
How do I code things in such a way where the user would click on a search result and the new page will open up in the parent window?
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.